[host] windows: do not complain about failed timer destruction at exit

When our window is destroyed, our timers are also destroyed. This causes our
attempt at destruction to fail. Instead, set MessageHWND to NULL in the
WM_DESTROY handler and don't try destroying the timers if the window is gone.
This commit is contained in:
Quantum 2021-07-22 06:13:43 -04:00 committed by Geoffrey McRae
parent 6382fc11af
commit 3cf0257f34
2 changed files with 2 additions and 1 deletions

View File

@ -65,7 +65,7 @@ void lgTimerDestroy(LGTimer * timer)
{
if (timer->running)
{
if (!KillTimer(MessageHWND, timer->handle))
if (MessageHWND && !KillTimer(MessageHWND, timer->handle))
DEBUG_ERROR("failed to destroy the timer");
}

View File

@ -205,6 +205,7 @@ LRESULT CALLBACK DummyWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_DESTROY:
Shell_NotifyIcon(NIM_DELETE, &app.iconData);
MessageHWND = NULL;
PostQuitMessage(0);
break;