win32: stop waiting for messages if the window is destroyed

GetMessageW will indefinitely block after the window is destroyed.
This commit is contained in:
nanahi 2024-01-20 18:29:31 -05:00 committed by Dudemanguy
parent 25bef997ce
commit 1ea9e51f78
1 changed files with 1 additions and 1 deletions

View File

@ -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.