Hi Nick, I've been contemplating the crash you have and the mismatch of pointers, which is little doubt down to multiple inheritance causing difference between the osg::Referenced location and the pointer to the actual object (class T for the template). This difference means that casting the pointer the osg::Referenced to the class T will result in an error, and the crash you are seeing is almost certainly down to this.
Give that the _ptr is of class T then it should be safe to use this to check for the referenceCount() so one fix would be just to use if (_ptr->referencedCount()==0). Given the role of objectDeleted() I don't think it really required to double check, the pointer really just can be reset. Could you do an svn update to the new mods that I've made to include/osg/observer_ptr and see if you're modified osgviewer and the standard osgcompositeviewer crash. I've attached the file. I'm optimistic that this bug is now squished so I'll move on to other build issues. Fingers crossed you'll report back success :-) Robert.
observer_ptr
Description: Binary data
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

