Skip to content

Commit

Permalink
message loop: fix a bug that a file dialog freezes (#165)
Browse files Browse the repository at this point in the history
Execute `KillTimer()` even if delayMS <= 0.
  • Loading branch information
HashidaTKS authored Mar 21, 2024
1 parent 06ff3e1 commit e2ac6ff
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions MessageLoopWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void MessageLoopWorker::OnScheduleWork(int64_t delayMs)
return;
}

KillTimer();
if (delayMs <= 0)
{
DoWork();
Expand All @@ -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;
Expand Down

0 comments on commit e2ac6ff

Please sign in to comment.