Hi Anders,
I've tried your app on Linux and works fine. I've also reviwed the code
and it seems to be OK. However I don't know about Windows dll stuff so
you might be overlooking something (atexit called after process threads
are cancelled?). In any case, as Robert says, the atexit function can be
completely avoided using static variables and class destructors, and
it's probably safer.
Why don't you try this modified version of your example to see what
happens?:
#define OTBUG_LIBRARY
#include "otbugdll.h"
struct Deallocator
{
~Deallocator()
{
if (t != 0) {
t->cancel();
delete t;
}
}
OpenThreads::Thread *t;
};
static Deallocator deallocator;
// Register atexit that will delete the thread
void regThread( OpenThreads::Thread *t)
{
deallocator.t = t;
}
Robert Osfield wrote:
Hi Anders,
I have just had a look at your test example and it fails to compile
under linux due to the atexit() method.
Reviewing the code I'm a bit confused why you are using atexit()
method at all. The OSG itself has lots of threads, objects and
singleton created in difference places at different times and works
fine with a platform specific exit mechanism, so I would have thought
it should be possible for your app as well.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org