[osg-submissions] Reworked osgviewerWX example
Paul Melis
paul at science.uva.nl
Mon Jun 16 00:59:40 PDT 2008
Hello Robert,
Here is a reworked version of the osgviewerWX example. It changes the
GraphicsWindowWX to only inherit from osgViewer::GraphicsWindow and adds
a standalone widget, called OSGCanvas, that derives from wxGLCanvas.
This solves a problem with the GraphicsWindowWX instance being
destructed twice (see "Crash in osgviewerWX" of June 12th on osg-users).
At program exit, the main frame deletes all of its children widgets and
therefore calls GraphicsWindowWX's destructor, bypassing OSG's reference
counting. The GraphicsWindowWX instance is then later destructed a
second time when the reference held by osg::Camera goes to zero. This
bug isn't exposed by the example directly, but if people are going to
use the example as a basis (like the poster in the mentioned thread)
they very likely will run into this problem.
Paul
More information about the osg-submissions
mailing list