[osg-users] Crashes after unloading library

8 views
Skip to first unread message

Gabriel Francu

unread,
May 16, 2013, 5:09:05 AM5/16/13
to osg-...@lists.openscenegraph.org
Hi,

I have an application built with Qt that uses osg to create a scene and to display it. I have also created a shared library that is loaded and unloaded by my application using QLibrary. In this library I create osg objects that are retained in objects created in the application. If I do not unload the library, all is ok but after I unload the library, strange crashes occurs in osg.

I suspect that these are related to memory allocation because osg objects are created on the heap in the shared library and then the shared library in unloaded. Any suggestions?
...

Thank you!

Cheers,
Gabriel

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54028#54028





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

Laurens Voerman

unread,
May 16, 2013, 5:29:26 AM5/16/13
to osg-...@lists.openscenegraph.org
Hi Gabriel,
First a question: what operating system are you using?
Second question: when your shared library gets unloaded, do any other
shared library's get unloaded as well? On windows I can imagines your
dll being linked to an osg part that will install callbacks in the
scengraph, (osgAnimation.dll as a possible example), while your main
application has no such link. On unloading the dependencies can be
unloaded as well, causing the callback to call an invalid memory location.

Regards, Laurens.

Gabriel Francu

unread,
May 16, 2013, 5:50:21 AM5/16/13
to osg-...@lists.openscenegraph.org
Hi Laurens,

Thank you for your answer.
I'm using Windows 7, VS 2005.
When I unload my library, there are some libraries used by my library that are unloaded, but no osg library is unloaded. In my library I only link to osgd.lib and OpenThreadsd.lib and these are not unloaded. The main application also links to these libraries.
...

Thank you!

Cheers,
Gabriel

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54030#54030
Reply all
Reply to author
Forward
0 new messages