Hi Carsten,
> With only one ref count shared across all aspect copies I'm not sure if
> this can be fixed in 1.x, I'm currently double checking that it works as
> expected in 2.0.
I tried to avoid the reference counting problem by cleaning up manually
before I delete an OpenSG node. That means I set all properties to NullFC.
In my understanding this should work, because every change is now covered
by the changelist and therefore correctly handled with 2 aspects. The
printOSGInstances() function shows 0 living FC?s, but unfortunately the
program still leaks memory. Not as much as before, but notable. Are there
any other ways to detect living OpenSG nodes?
For example, this is what I'm doing to delete a ChunkMaterial:
ChunkMaterialPtr mOSGMaterial = ChunkMaterialPtr::dcast(node->getCore());
beginEditCP(mOSGMaterial);
while (mOSGMaterial->getChunks().size() > 0)
{
StateChunkPtr chunk = mOSGMaterial->getChunks()[0];
TextureChunkPtr tex_chunk = TextureChunkPtr::dcast(chunk);
if (tex_chunk != NullFC)
{
beginEditCP(tex_chunk->getImage());
tex_chunk->getImage()->clearData();
endEditCP(tex_chunk->getImage());
beginEditCP(tex_chunk);
tex_chunk->setImage(NullFC);
endEditCP(tex_chunk);
}
mOSGMaterial->subChunk(chunk);
}
endEditCP(mOSGMaterial);
beginEditCP(node);
node->setCore(NullFC);
endEditCP(node);
// sync threads
// ...
Any ideas?
Thanks!
Marc------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users