Hello Michael,

On 05/16/2011 09:37 AM, Michael Raab wrote:
> we have build an additional OpenSG library that contains a few additional 
> field container types.
> When initializing our application we use osg::preloadSharedObject() to load 
> the library. During runtime everything seems to be fine. But when calling 
> osgExit() the application crashes.I tried to debug into osgExit() and can 
> tell you that it crashes in FieldContainerFactory::terminateFactory().

hmm, the most likely place in there is when it terminates the registered 
FieldContainerType objects. I could imagine a crash there if it attempts 
to terminate a type from a shared lib that has already been unloaded - 
in that case the static type object is already gone when the factory 
attempts to access it.

> The crashed is caused by an access violation.
> Is there some kind of special handling for extension libraries like ours 
> necessary before calling osgExit()?

This is on windows, right?
Do you call to osgExit() explicitly or is this done from an atexit() 
handler (e.g. by the one OpenSG registers)?
On windows there is some interaction between shared libs and atexit(). 
AFAIUI each DLL has it's own atexit() stack that is separate from the 
application one. Is there a tool that can track loading/unloading of 
DLLs, if so it would probably be helpful to check when your extension 
lib is unloaded with respect to when osgExit() runs.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to