Hello,

I have another problem/misunderstanding with respect to deep cloning.

I have a ChunkMaterial which I need to clone. The material has embedded
ClipPlaneChunks with properly initialized beacon fields. Now, I have
discovered that the ClipPaneChunks of the deep copied ChunkMaterial
still has initialized beacon fields, but on calling getBeacon() on them,
I got a Null pointer. Inspection revealed that the _iRefCount is zero
which prevents returning the beacon object in the following code:

OSGContainerRefCountPolicies.inl

template <class ObjT>
inline ObjT *
WeakRefCountPolicy::validate(ObjT *pObject)
{
    if(pObject == NULL)
    {
        return NULL;
    }
    else
    {
        return (pObject->getRefCount() > 0) ? pObject : NULL;
    }
}

>
OSGStateD.dll!OSG::WeakRefCountPolicy::validate<OSG::FieldContainer>(OSG
::FieldContainer * pObject=0x000000001a64b780)  Line 187        C++
 
OSGStateD.dll!OSG::PointerAccessHandler<OSG::WeakRefCountPolicy>::valida
te<OSG::FieldContainer>(OSG::FieldContainer * const
pObject=0x000000001a64b780)  Line 128   C++
 
OSGStateD.dll!OSG::PointerSFieldCommon<OSG::PointerAccessHandler<OSG::We
akRefCountPolicy>,0>::ptrStoreGet()  Line 98    C++
        OSGStateD.dll!OSG::PointerSField<OSG::Node *
__ptr64,OSG::WeakRefCountPolicy,0>::getValue()  Line 108        C++
        OSGStateD.dll!OSG::ClipPlaneChunkBase::getBeacon()  Line 133
C++
 
RenderEngineD.dll!RenderEngine::tools::check_clip_plane_chunk(OSG::Chunk
Material * mat=0x000000001a64db20)  Line 215 + 0x19 bytes       C++

My question is now, is that correct by design, from which it follows
that I have made a user mistake? Or could I expect to get a valid
object?

I ran into this problem by carefully inspecting the OpenSG log file I
have written. It has an entry for a missing beacon node originating from
the ClipPlaneChunk::changeFrom method. There is also a test on
getBeacon() != NULL...

So, I need some clarification...

Best,
Johannes





____________
Virus checked by G DATA AntiVirusKit
Version: AVF 22.556 from 29.02.2012
Virus news: www.antiviruslab.com

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to