Hello Michael,

Michael Raab wrote:
> I think I found the problem or even a work around.
> When I try to clean up unused materials, I use subChunk() in the destructor 
> of my Material class to remove sequentially all chunks from my current 
> ChunkMaterial. Btw, I have ein RefPtr<> on each chunk and on the 
> ChunkMaterial. After that I set the RefPtr<> of the ChunkMaterial to NullFC! 
> In this situation the crash occurs.

ok, I'm starting to understand what is happening. The Materials have a 
StatePtr that is not in a field, which means the pointed-to State object 
is different on the remote side from the local one (different here 
meaning the two are not synchronized, but instead they are independent 
from each other).
Now, if you destroy the chunks a 'Destroy' entry goes into the 
changelist and the remote side destroys the chunks. However the State 
object on the remote side still contains pointers to the chunks and when 
you then destroy the ChunkMaterial its destructor wants to clean up the 
State object and the chunks it points to - but of course the chunks are 
already gone and the pointers are invalid.

> If I remove the removal of the chunks before setting the Chunkmaterial 
> RefPtr<> to NullFC, the application runs without problems. Maybe a reference 
> problem?

yes, ultimately this is a ref count problem and I think the basic 
problem is that the 'Destroy' CL entries are essentially bypassing the 
ref counting on the remote side and simply destroy the object, 
independent of references that exist on the remote side alone.

Fixing this in 1.x would require some larger surgery in the ref 
counting/cluster code - one of the reasons we redid the whole thing for 
2.0. Your workaround is fine though and does not have any drawbacks 
(apart from the fact that it is not very obvious why your original 
approach causes problems ;) ).

        Cheers,
                Carsten

------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to