From: Torsten Dreyer Date: Sun, 27 Apr 2014 19:38:24 +0000 (+0200) Subject: Temporary fix for crash in FGVoiceMgr on reset X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=38e2b8b11c6d3796a27e5247f0780104234561f8;p=flightgear.git Temporary fix for crash in FGVoiceMgr on reset --- diff --git a/src/Sound/voice.cxx b/src/Sound/voice.cxx index 04f8c4ef7..c808edd67 100644 --- a/src/Sound/voice.cxx +++ b/src/Sound/voice.cxx @@ -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::iterator it = _voices.begin(); it != _voices.end(); ++it )