From e2ac6ff2406d10db11563bb842c45e4dfd04308a Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Thu, 21 Mar 2024 12:17:06 +0900 Subject: [PATCH] message loop: fix a bug that a file dialog freezes (#165) Execute `KillTimer()` even if delayMS <= 0. --- MessageLoopWorker.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MessageLoopWorker.cpp b/MessageLoopWorker.cpp index c29025c..fe679d7 100644 --- a/MessageLoopWorker.cpp +++ b/MessageLoopWorker.cpp @@ -61,6 +61,7 @@ void MessageLoopWorker::OnScheduleWork(int64_t delayMs) return; } + KillTimer(); if (delayMs <= 0) { DoWork(); @@ -69,8 +70,6 @@ void MessageLoopWorker::OnScheduleWork(int64_t delayMs) { // If | delayMs | is > 0 then the call should be scheduled to happen after the specified delay // and any currently pending scheduled call should be cancelled. - KillTimer(); - if (delayMs > m_nMaxTimerDelay) { delayMs = m_nMaxTimerDelay;