[host] fix faults caused by improper startup/shudown/restart ordering

This commit is contained in:
Geoffrey McRae
2021-01-21 17:05:30 +11:00
parent 6b8161972d
commit 04774d9cd6
4 changed files with 55 additions and 26 deletions

View File

@@ -146,6 +146,7 @@ void mouseHook_remove(void)
{
if (!mouseHook.event)
return;
SetEvent(mouseHook.event);
WaitForSingleObject(mouseHook.thread, INFINITE);
CloseHandle(mouseHook.thread);

View File

@@ -146,7 +146,6 @@ static int appThread(void * opaque)
int result = app_main(app.argc, app.argv);
Shell_NotifyIcon(NIM_DELETE, &app.iconData);
mouseHook_remove();
SendMessage(app.messageWnd, WM_DESTROY, 0, 0);
return result;
}