diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index 4d3ee49..2e706fd 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -1256,8 +1256,10 @@ static ~this() if (is_main_thread) { shared(TaskPool) tpool; synchronized (st_threadsMutex) swap(tpool, st_workerPool); - logDiagnostic("Main thread still waiting for worker threads."); - tpool.terminate(); + if (tpool) { + logDiagnostic("Main thread still waiting for worker threads."); + tpool.terminate(); + } logDiagnostic("Main thread exiting"); }