Hi Robert, the dll is not undloaded. When I do
viewer = 0; the viewer address and the one that gets down to objectDeleted(void* ptr) are slightly different, means viewer.get() != ptr. _ptr is not equal to obj -Nick On Fri, Feb 19, 2010 at 6:37 PM, Robert Osfield <[email protected]>wrote: > Hi Nick, > > On Fri, Feb 19, 2010 at 4:27 PM, Trajce (Nick) Nikolov > <[email protected]> wrote: > > Hi Robert, > > I have more input now after tracing this issue > > virtual void objectDeleted(void* obj) > > { > > T* ref_obj = static_cast<T*>(obj); > > OpenThreads::ScopedLock<OpenThreads::Mutex> > > lock(*getObserverMutex()); > > if (ref_obj->referenceCount() == 0) _ptr = 0; > > } > > ref_obj seam to be deleted here. It is not NULL and it has bunch of non > > sense data in the members. Any idea? > > Curious. the objectDeleted(void*) method should be called on all the > observers of an object prior to the objects deletion - the delete is > called after the call to the observers. > > You could try removing the if (ref_obj->referenceCouint()==0) part and > just leave the _ptr as they should be safe, the if statement is just > there for a belt and braces approach to the method and isn't critical. > While there is might fix the crash it wouldn't actually explain it. > > Is there any chance that your app has unloaded a dll before all the > data associated with it has been safely destructed? > > Another little check you could do is check the value of obj compared > to _ptr, in theory they should be the same but if they aren't then we > know that something else is going wrong along the way. > > 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

