]> git.mxchange.org Git - flightgear.git/commitdiff
Clear the custom OSG notify logger on shutdown.
authorJames Turner <zakalawe@mac.com>
Sun, 12 Jan 2014 17:18:35 +0000 (17:18 +0000)
committerJames Turner <zakalawe@mac.com>
Sun, 12 Jan 2014 17:18:35 +0000 (17:18 +0000)
Should avert crashes due to order of static destruction.

src/Viewer/fg_os_osgviewer.cxx

index 72481bc89411304d845fc9f548dab74f46166a95..7ba9932180ae44d6d6a0f73b639110d319d4c3c9 100644 (file)
@@ -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()