Hi,

I have discovered that this line of code:

    toNode->getOrCreateStateSet()->merge(*(fromNode->getOrCreateStateSet())) ;

seems to cause a memory leak.  I busted it up:
    osg::StateSet *fromNodeStateSet = fromNode->getOrCreateStateSet() ;
    osg::StateSet *toNodeStateSet = toNode->getOrCreateStateSet() ;
    toNodeStateSet->merge(*fromNodeStateSet) ;

and it still leaks.  If I comment out the third line the leak goes away.  (I
print the pointers, so hopefully the optimizer doesn't just toss all three
lines.)

Using either of these commands, although less than useful:
    toNodeStateSet->merge(*toNodeStateSet) ;
    fromNodeStateSet->merge(*fromNodeStateSet) ;
doesn't cause the leak.

Both nodes have StateSets, so this also works, and also leaks:
    osg::StateSet *fromNodeStateSet = fromNode->getStateSet() ;
    osg::StateSet *toNodeStateSet = toNode->getStateSet() ;
    toNodeStateSet->merge(*fromNodeStateSet) ;

I'm sort of stumped, and hoping the group might have some suggestions of what
might be the source of the leak.

I'm using OSG Version 2.6.1, Linux.

Many thanks,

John

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to