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 )