From 4c60409aaf9d02b92f3f85178cf9cff6e4d2472b Mon Sep 17 00:00:00 2001 From: Quantum Date: Thu, 22 Jul 2021 02:57:32 -0400 Subject: [PATCH] [host] windows: use WM_CLOSE to signal window destruction DestroyWindow can only be invoked on the thread that created the window. All other threads must use WM_CLOSE or another message to signal tell the window to destroy itself. --- host/platform/Windows/src/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/platform/Windows/src/platform.c b/host/platform/Windows/src/platform.c index da7d8ce7..8d6ee690 100644 --- a/host/platform/Windows/src/platform.c +++ b/host/platform/Windows/src/platform.c @@ -257,7 +257,7 @@ static int appThread(void * opaque) { RegisterTrayIcon(); int result = app_main(app.argc, app.argv); - DestroyWindow(app.messageWnd); + SendMessage(app.messageWnd, WM_CLOSE, 0, 0); return result; }