diff --git a/Foundation/src/ThreadPool.cpp b/Foundation/src/ThreadPool.cpp index df1a23e17..398469450 100644 --- a/Foundation/src/ThreadPool.cpp +++ b/Foundation/src/ThreadPool.cpp @@ -192,10 +192,11 @@ void PooledThread::run() _mutex.lock(); if (_pTarget) // a NULL target means kill yourself { + Runnable* pTarget = _pTarget; _mutex.unlock(); try { - _pTarget->run(); + pTarget->run(); } catch (Exception& exc) {