From bfe1c46a7308c72c030accd166355fec007b4c11 Mon Sep 17 00:00:00 2001 From: Satoshi Date: Mon, 12 Dec 2016 11:31:16 +0100 Subject: [PATCH] Update timer.d Don't remove callback when timer is periodic because after first hit cb cannot be called again? --- source/eventcore/drivers/timer.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/eventcore/drivers/timer.d b/source/eventcore/drivers/timer.d index dd63479..a2b83ae 100644 --- a/source/eventcore/drivers/timer.d +++ b/source/eventcore/drivers/timer.d @@ -63,7 +63,10 @@ final class LoopTimeoutTimerDriver : EventDriverTimers { foreach (tm; m_firedTimers) { auto cb = tm.callback; - tm.callback = null; + if (!tm.pending) { + tm.callback = null; + } + if (cb) cb(tm.id); }