From Ryan Kawicki, "I found a memory leak within the Terrex plugin.
From Ryan Kawicki, "I found a memory leak within the Terrex plugin.

Out application has the ability to switch to different types of terrains on the fly.  This problem only exists in this type of situation.

The TXPArchive is held by the ReadWriterTXP class.  When the TXPNode, which is the top level node, is released from memory, the archive associated to that TXPNode is also released.  The issue is that the reference count on the TXPArchive never gets to zero.

The reason why the reference count never gets to zero is because the TXPParse, which is owned by the TXPArchive, stores a ref_ptr to the TXPArchive.  You can then see why this becomes a problem.  The TXPParser's ref_ptr cannot be unreferenced since the TXPArchive has not released the TXPParser.

Since the TXPParser is fully contained within the TXPArchive, I don't see the reason to have the TXPParser have a ref_ptr to the TXPArchive.  I've made this change locally and have had no problems and our memory leak has been fixed.
"


scrawl/osg,artoolkit/osg,marchelbling/osg,artoolkit/osg,tomasthoresen/osg,openscenegraph/osg,marchelbling/osg,scrawl/osg,artoolkit/osg,scrawl/osg,jtorresfabra/osg,jtorresfabra/osg,scrawl/osg,openscenegraph/osg,tomasthoresen/osg,jtorresfabra/osg,jtorresfabra/osg,openscenegraph/osg,openscenegraph/osg,tomasthoresen/osg,marchelbling/osg,tomasthoresen/osg,marchelbling/osg,artoolkit/osg