]> git.mxchange.org Git - flightgear.git/blobdiff - src/Viewer/fg_os_osgviewer.cxx
commradio: improvements for atis speech
[flightgear.git] / src / Viewer / fg_os_osgviewer.cxx
index 5d85dcabae07d491451cdde652f94c73f36ce628..7ba9932180ae44d6d6a0f73b639110d319d4c3c9 100644 (file)
@@ -102,7 +102,6 @@ using namespace flightgear;
 using namespace osg;
 
 osg::ref_ptr<osgViewer::Viewer> viewer;
-static osg::ref_ptr<osg::Camera> mainCamera;
 
 static void setStereoMode( const char * mode )
 {
@@ -316,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()
@@ -357,7 +361,6 @@ void fgOSInit(int* argc, char** argv)
 void fgOSCloseWindow()
 {
     FGScenery::resetPagerSingleton();
-    mainCamera = NULL;
     flightgear::CameraGroup::setDefault(NULL);
     WindowSystemAdapter::setWSA(NULL);
     viewer = NULL;