]> git.mxchange.org Git - flightgear.git/commitdiff
Temporary fix for crash in FGVoiceMgr on reset
authorTorsten Dreyer <torsten@t3r.de>
Sun, 27 Apr 2014 19:38:24 +0000 (21:38 +0200)
committerTorsten Dreyer <torsten@t3r.de>
Sun, 27 Apr 2014 19:38:24 +0000 (21:38 +0200)
src/Sound/voice.cxx

index 04f8c4ef7956c82c4e56502f6e04b016a38d76f8..c808edd67c86cc5ea0ad2d359acc99b8d766d397 100644 (file)
@@ -117,10 +117,13 @@ void FGVoiceMgr::init()
 void FGVoiceMgr::shutdown()
 {
 #if defined(ENABLE_THREADS)
-  _thread->cancel();
-  _thread->join();
-  delete _thread;
-  _thread = NULL;
+  SG_LOG(SG_ALL,SG_ALERT,"FGVoiceMgr::shutdown");
+  if( _thread ) {
+    _thread->cancel();
+    _thread->join();
+    delete _thread;
+    _thread = NULL;
+  }
 #endif
 
   for( std::vector<FGVoice*>::iterator it = _voices.begin(); it != _voices.end(); ++it )