Hi Moji,

So is there any specific reason for using ref_ptr instead of observer_ptr in definition of osgViewer::View::EventHandlers?

The viewer owns the event handlers, thus ref_ptr is the right choice. The normal usage of an event handler is:

    viewer->addEventHandler(new MyEventHandler);

and thus the use of ref_ptr is appropriate in that case.

Perhaps one solution would be to move the event handler functionality of your wrapper class into another internal class, add that event handler to the viewer and then use ref_ptr on your viewer but observer_ptr on your event handler. There would then be no ref_ptr cycles.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to