From 3dbdc909273b8600a4db127b8f673b639a0f56ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 22 Feb 2017 23:26:16 +0100 Subject: [PATCH] Fix shutdown when no worker tasks have been used. --- source/vibe/core/core.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"); }