diff --git a/source/shared_lib/sources/platform/sdl/thread.cpp b/source/shared_lib/sources/platform/sdl/thread.cpp index 4a635632e..c4ce01e18 100644 --- a/source/shared_lib/sources/platform/sdl/thread.cpp +++ b/source/shared_lib/sources/platform/sdl/thread.cpp @@ -197,7 +197,11 @@ void Thread::queueAutoCleanThread() { //printf("In Thread::shutdownThreads Line: %d\n",__LINE__); cleanupThread.reset(new ThreadGarbageCollector()); cleanupThread->start(); - sleep(0); + for(time_t elapsed = time(NULL); + cleanupThread->getRunningStatus() == false && + difftime(time(NULL),elapsed) < 6;) { + sleep(5); + } } cleanupThread->addThread(this); //printf("In Thread::shutdownThreads Line: %d\n",__LINE__);