]> git.mxchange.org Git - flightgear.git/commitdiff
fix hang on exit when multithreaded (bug 1830)
authorRebecca N. Palmer <rebecca_palmer@zoho.com>
Mon, 15 Aug 2016 06:58:40 +0000 (07:58 +0100)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:49 +0000 (23:27 +0200)
src/Viewer/fg_os_osgviewer.cxx

index 0799ffe4af1cd01315077bf66b7b5882f5360f89..61319cfc8d11603a358651701bde605278354e8f 100644 (file)
@@ -362,6 +362,14 @@ void fgOSInit(int* argc, char** argv)
 
 void fgOSCloseWindow()
 {
+    if (viewer) {
+        // https://code.google.com/p/flightgear-bugs/issues/detail?id=1291
+        // https://sourceforge.net/p/flightgear/codetickets/1830/
+        // explicitly stop trheading before we delete the renderer or
+        // viewMgr (which ultimately holds refs to the CameraGroup, and
+        // GraphicsContext)
+        viewer->stopThreading();
+    }
     FGScenery::resetPagerSingleton();
     flightgear::CameraGroup::setDefault(NULL);
     WindowSystemAdapter::setWSA(NULL);