diff --git a/common/src/platform/windows/time.c b/common/src/platform/windows/time.c index 3a46ab45..09dc2fc7 100644 --- a/common/src/platform/windows/time.c +++ b/common/src/platform/windows/time.c @@ -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"); } diff --git a/host/platform/Windows/src/platform.c b/host/platform/Windows/src/platform.c index 8d6ee690..295f33e1 100644 --- a/host/platform/Windows/src/platform.c +++ b/host/platform/Windows/src/platform.c @@ -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;