From 1ea9e51f782129a82fcf0defdda66c3bcaa6c748 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sat, 20 Jan 2024 18:29:31 -0500 Subject: [PATCH] win32: stop waiting for messages if the window is destroyed GetMessageW will indefinitely block after the window is destroyed. --- video/out/w32_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 60452788eb..22278160be 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -1710,7 +1710,7 @@ static bool is_key_message(UINT msg) static void run_message_loop(struct vo_w32_state *w32) { MSG msg; - while (GetMessageW(&msg, 0, 0, 0) > 0) { + while (!w32->destroyed && GetMessageW(&msg, 0, 0, 0) > 0) { // Change the conversion mode on the first keypress, in case the timer // solution fails. Note that this leaves the mode indicator in the language // bar showing the original mode until a key is pressed.