Hi Philip,

You should use the osgDB for opening and closing plugins.  In
osgDB::Registry you'll find:

       /** find the library in the OSG_LIBRARY_PATH and load it.*/
       bool loadLibrary(const std::string& fileName);

       /** close the attached library with specified name.*/
       bool closeLibrary(const std::string& fileName);

This way you'll ensure that all the OSG data structures that it sets
up related to the plugin are cleaned up and the code will be 100%
portable.

Robert.

On 12/7/06, Philip Lowman <[EMAIL PROTECTED]> wrote:
Hi,

We're trying to use OSG within a dynamically loaded plugin in our code.
  Whenever we call dlclose() on our plugin, however, shortly after
main() returns we segfault.  I was wondering if anyone who's worked with
OSG has heard of this kind of problem before?

I've attached an example of what we're doing which reproduces our
problem.  We're running OSG 1.2.

--
Philip Lowman
Simulation Development Engineer, Modeling and Simulation Technology
General Dynamics Land Systems
http://www.gdls.com


default: main osgtest.so

main: main.cc
        g++ -o $@ main.cc -ldl

osgtest.so : osgtest.o
        g++ -shared -Wl,-soname,osgtest -o $@ osgtest.o -losg -losgDB

clean:
        rm -f main
        rm -f *.o
        rm -f osgtest.so


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to