diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index cbef0d0..b34b876 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -1140,8 +1140,8 @@ package(vibe) void performIdleProcessing() if (again) { auto er = eventDriver.core.processEvents(0.seconds); - if (er.among!(ExitReason.exited, ExitReason.outOfWaiters)) { - logDebug("Setting exit flag due to driver signalling exit"); + if (er.among!(ExitReason.exited, ExitReason.outOfWaiters) && s_scheduler.scheduledTaskCount == 0) { + logDebug("Setting exit flag due to driver signalling exit: %s", er); s_exitEventLoop = true; return; }