On 9/8/2010 10:26 AM, Jean-Sébastien Guay wrote:
Hi Todd,
Thanks for the suggestions. I just tried that, and unfortunately this
particular exception seems to occur *after* exit. It seems to be this
error:
http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/afebacc2-65e6-43f8-b7aa-73bfd5ade11d
Anyway, thanks again. I'm pretty sure this isn't an OSG problem, but
I'll post an update if it turns out to be one.
Well that post relates to VB garbage collection and Crystal Reports, so
I'm pretty sure it's not related :-)
A crash on exit is generally a double-delete... Are you using ref_ptrs
for all your OSG variables? Or are you doing weird things with memory
allocation?
Small anecdote on that subject:
A while ago we had a class in our code base that derived from an OSG
class (so from osg::Referenced indirectly) but declared its destructor
public. So users of that class could delete it while it was still in the
scene graph, and when OSG (through ref counts falling to 0 and cascading
deletes of ref_ptrs) came to delete it, it had already been deleted,
thus the app crashed on exit. So making the destructor of an
osg::Referenced-derived class public is a no-no, unless you can make
sure to remove it from all OSG structures before you delete it (which is
a lot of work for not much gain, IMHO, so just keep that destructor
protected and all will be fine).
Hope this helps,
J-S
OK, I tracked this one down and wanted to share. I was compiling the
Outline class with my app - my app uses OSG 2.8.3, but the class is from
the OSG trunk. Apparently, this line was causing the problem:
Registry::Proxy proxy(new Outline);
The class works fine without that line, so commenting it out fixed the
problem. I think that this wouldn't have been an issue at all if I just
used the OSG trunk completely, but I'm trying to stick with official
releases for apps we develop.
-Todd
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org