From a4e75417e434eb0940e53662def2cd15c443461f Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 27 Aug 2010 03:00:57 +0000 Subject: [PATCH] - added safety check to thread execution --- source/shared_lib/sources/platform/sdl/thread.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/shared_lib/sources/platform/sdl/thread.cpp b/source/shared_lib/sources/platform/sdl/thread.cpp index 2871a341..764c28c4 100644 --- a/source/shared_lib/sources/platform/sdl/thread.cpp +++ b/source/shared_lib/sources/platform/sdl/thread.cpp @@ -11,9 +11,12 @@ #include #include #include +#include #include "noimpl.h" +using namespace std; + namespace Shared{ namespace Platform{ // ===================================== @@ -39,6 +42,10 @@ void Thread::setPriority(Thread::Priority threadPriority) { int Thread::beginExecution(void* data) { Thread* thread = static_cast (data); + assert(thread != NULL); + if(thread == NULL) { + throw runtime_error("thread == NULL"); + } thread->execute(); return 0; }