Hi,
Carsten Neumann wrote:
> yes, talking with a colleague (thanks Aashish!) yesterday and some
> googeling we came to the same result, DLLs have their own atexit handler
> stack. And since osgInit is in the OSGBase.dll the osgExitWrapper ends
> up on that atexit stack.
> From what we read, it is also the case that atexit handlers registered
> from the application (i.e. not a DLL) end up on a stack that runs before
> DLL unloading begins, so if we can get onto that stack everything should
> be fine.
> I wanted to try to inline that part of osgInit (basically split it into
> the bulk of its body and the atexit registration and make sure the
> latter is inlined into main).
the inline trick seems to work, the following
int main(int argc, char *argv[])
{
atexit(beforeOsgInit);
osgInit(argc, argv);
atexit(afterOsgInit);
getDefaultMaterial();
return 0;
}
produces:
afterOsgInit
// noise from osgExit
beforeOsgInit
so osgExit runs from the application atexit stack. Patch committed as r1599.
Many thanks to everybody who helped in understanding and solving this issue!
Thanks,
Carsten
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users