Skip to content

Commit 60fb811

Browse files
committed
windows: clean up uiTimer timers on uninit
- stop active Win32 timers before freeing libui timer state - match Unix and macOS uninit cleanup behavior - avoid stale WM_TIMER callbacks after app shutdown begins
1 parent 62b752f commit 60fb811

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

windows/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ void uiprivFreeTimer(uiprivTimer *t)
154154
void uiprivUninitTimers(void)
155155
{
156156
// TODO why doesn't auto t : timers work?
157-
for (auto t = timers.begin(); t != timers.end(); t++)
157+
for (auto t = timers.begin(); t != timers.end(); t++) {
158+
if (KillTimer(utilWindow, (UINT_PTR) t->first) == 0)
159+
logLastError(L"error calling KillTimer() to clean up uiTimer() procedure");
158160
uiprivFree(t->first);
161+
}
159162
timers.clear();
160163
}

0 commit comments

Comments
 (0)