From: James Turner Date: Sun, 12 Jan 2014 17:18:35 +0000 (+0000) Subject: Clear the custom OSG notify logger on shutdown. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=73163604219792ef946dba7c121e48c42391a789;p=flightgear.git Clear the custom OSG notify logger on shutdown. Should avert crashes due to order of static destruction. --- diff --git a/src/Viewer/fg_os_osgviewer.cxx b/src/Viewer/fg_os_osgviewer.cxx index 72481bc89..7ba993218 100644 --- a/src/Viewer/fg_os_osgviewer.cxx +++ b/src/Viewer/fg_os_osgviewer.cxx @@ -315,6 +315,11 @@ void fgOSExit(int code) viewer->setDone(true); viewer->getDatabasePager()->cancel(); status = code; + + // otherwise we crash if OSG does logging during static destruction, eg + // GraphicsWindowX11, since OSG statics may have been created before the + // sglog static, despite our best efforts in boostrap.cxx + osg::setNotifyHandler(new osg::StandardNotifyHandler); } int fgOSMainLoop()