Hi Mario, I'm not the author of osgviewerWX, and not familiar with WxWidgets, but checking through the code right now my best guess at the error would be down to WxWidgets deleting the GraphicsWindowWX whilst the osgViewer::Viewer still has a reference to it.
I'm not sure of the best solution to this, one has to resolve the issue of GraphicsWindowWX being owned by both WxWidgets and Viewer, one could possible tweak the later so it supports use of observer_ptr<GraphicsContext> and an option in place of the existing ref_ptr<GraphcicsContext> (note this is related to osg::Camera::setGraphicsContext(,,)). I have recently added a similiar approach into SceneView w.r.t to its use of osg::Camera, in this case it was to avoid circular dependencies that would have otherwise been introduced with the new osgViewer::Renderer. The other approach might be to have a wxOSGCanvas that owns a GraphicsWindowWX, and GraphicsWindowWX has a weak pointer back to wxOSGCanvas and use it to implement all the GraphicsWindow::*Implementation() methods. When wxOSGCanvas is deleted by WxWidgets it unref's GraphicsWindowWX and resets the weak pointer back to itself. The osgViewer which would reference the GraphicsWindowWX via its Camera would still maintain itself reference safely, albeit with non op implementations. Robert. On 8/6/07, Mario Valle <[EMAIL PROTECTED]> wrote: > SVN from this morning, wxWidgets 2.7.0-1 gtk. > > Run osgviewerWX (or also osgviewerWXd) and close the window with the right X > button. > The application exits with the following warning: > > Warning: deleting still referenced object 0x81b2be8 of type > 'PN3osg10ReferencedE' > the final reference count was 1, memory corruption possible. > > The strange thing is that running osgviewerWXd under valgrind reveals > problems inside the > Qt library (see below)! > > Warning: deleting still referenced object 0x781e408 of type > 'PN3osg10ReferencedE' > the final reference count was 1, memory corruption possible. > ==10434== > ==10434== Invalid read of size 4 > ==10434== at 0x6738746: QApplication::notify(QObject*, QEvent*) (in > /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x6799DB2: QObject::removeChild(QObject*) (in > /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x679936E: QObject::~QObject() (in > /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x6754A0A: QFontCache::~QFontCache() (in > /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x674F949: (within /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x51D0203: exit (in /lib/tls/libc-2.3.5.so) > ==10434== by 0x51BAEA7: (below main) (in /lib/tls/libc-2.3.5.so) > ==10434== Address 0x6DDF314 is 4 bytes inside a block of size 8 free'd > ==10434== at 0x401C489: operator delete(void*) (vg_replace_malloc.c:244) > ==10434== by 0x673F31D: QPtrList<QPostEvent>::deleteItem(void*) (in > /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x6A5392C: QGList::clear() (in > /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x673F81C: QPostEventList::~QPostEventList() (in > /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x6737B09: (within /usr/lib/qt3/lib/libqt-mt.so.3.3.4) > ==10434== by 0x51D0203: exit (in /lib/tls/libc-2.3.5.so) > ==10434== by 0x51BAEA7: (below main) (in /lib/tls/libc-2.3.5.so) > > Strange... > Anyway, setting the notification level show a problem with > GraphicsContext::unregisterGraphicsContext > > Viewer::~Viewer():: start destructor getThreads = 0 > close(1)0x81b4af8 > Releasing GL objects for Camera=0x81c4d50 _state=0x81c4968 > Closing still viable window 0 _state->getContextID()=0 > Doing Flush > Done Flush 100 > decrementUsageCount()0 > GraphicsContext::decrementContextIDUsageCount(0) to 0 > Viewer::~Viewer() end destrcutor getThreads = 0 > Destructing osg::View > Done destructing osg::View > close(0)0x81b4af8 > Releasing GL objects for Camera=0x81c4d50 _state=0 > GraphicsContext::unregisterGraphicsContext 0x81b4af8 > Warning: deleting still referenced object 0x81b4af8 of type > 'PN3osg10ReferencedE' > the final reference count was 1, memory corruption possible. > Closing DynamicLibrary osgdb_osg.so > Closing DynamicLibrary osgdb_rgb.so > ~RegisterWindowingSystemInterfaceProxy() > GraphicsContext::setWindowingSystemInterface() 0 0x403e0e18 > > Hope could be useful > mario > > -- > Ing. Mario Valle > Visualization Group | http://www.cscs.ch/~mvalle > Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60 > v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82 > > _______________________________________________ > 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

