From eec6d4f59c30969ea41b7a16d0bede701b843921 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 18 Jun 2013 22:26:12 +0000 Subject: [PATCH] bugfix for pure virtual error on garbage collector thread --- source/shared_lib/sources/platform/sdl/thread.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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__);