diff --git a/lib/base/workqueue.cpp b/lib/base/workqueue.cpp index 427bbcae1..e8209fe98 100644 --- a/lib/base/workqueue.cpp +++ b/lib/base/workqueue.cpp @@ -220,6 +220,10 @@ void WorkQueue::WorkerThreadProc(void) m_ExceptionCallback(boost::current_exception()); } + /* clear the task so whatever other resources it holds are released + _before_ we re-acquire the mutex */ + task = Task(); + lock.lock(); m_Processing--;