Doh! That was easy. Amazing what another pair of brackets can accomplish. Thanks for the quick fix.
(It gets ugly if I don't call osgExit() at all, but I suspect it's due to similar logic playing out in the d'tors. Anyway, it's clean now.) -- Ted -----Original Message----- From: Carsten Neumann [mailto:carsten_neum...@gmx.net] Sent: Tuesday, March 23, 2010 17:37 To: opensg-users@lists.sourceforge.net Subject: Re: [Opensg-users] VRML and exit() woes Hello Theodore, Hall, Theodore wrote: > OpenSG 2.0 (64-bit Vista DLL) is crashing in its exit routines after > having loaded a ".wrl" file into a SimpleSceneManager. The app runs > fine until the window closes and the app quits. Also, it exits cleanly > if I use a hard-coded scene instead of loading from a "wrl" file. > > It fails differently depending on whether I explicitly call osgExit(), > or let the atexit functions handle the cleanup, but it fails in either > case. [SNIP - backtraces/notes] > * I call OSG::osgExit() just before the App object goes out of scope > and its d'tor is called. There are no explicit references to any > OSG objects beyond that point, but there is a chain of d'tors for > OSG::RefCountPtrs, OSG::RecordedRefCountPolicys, and > boost::shared_ptrs so it looks like this: { App app; // ... OSG::osgExit(); } ? Basically the problem is that you shut down OpenSG while OpenSG objects are still alive, something the system does not deal well with. Try this: { { App app; // ... } OSG::osgExit(); } > * I note that there are two OSG::SimpleSceneManagerRefPtr's referencing > the same object, to be cleaned up in the d'tor chain. Is that a > problem? I don't think that is a problem. Multiple pointer to the same object are fine and the ref count should take care of destroying the object exactly once, after all pointers are gone. > (And why would that be sensitive to whether or not the > scene was loaded from a ".wrl" file?) I suspect that is just a coincidence. hings loaded from a file tend to create more containers so the chance for one of them crashing on exit gets higher. Cheers, Carsten ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users