From e7a9c01bf699ab4064c5ed3b8ecfb5fa53269d7d Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Thu, 14 Jan 2016 19:18:03 -0800 Subject: [PATCH] - try to add more verbose output on app shutdown --- source/glest_game/main/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index bfd1ac7fa..d95391d19 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -5828,16 +5828,30 @@ int glestMain(int argc, char** argv) { SoundRenderer &soundRenderer= SoundRenderer::getInstance(); if( Config::getInstance().getString("FactorySound","") != "None" && soundRenderer.isVolumeTurnedOff() == false) { + + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + for(;chronoshutdownFadeSound.getMillis() <= shutdownFadeSoundMilliseconds;) { sleep(10); } } + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + BaseThread::shutdownAndWait(soundThreadManager); + + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + delete soundThreadManager; soundThreadManager = NULL; } + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); + return 0; }