Avoid WM_QUIT loop by posting it directly to thread message queue.

Based on patch by Chad Austin (bug 480220).

Fixes a rare infinite loop in FFXIV Launcher when changing layout (which
restarts it).

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2023-04-03 17:56:28 +03:00 committed by Jacek Caban
parent 04ef8cdae6
commit e3eff67fed

View File

@ -357,8 +357,9 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
if (gotMessage) {
if (msg.message == WM_QUIT) {
::PostQuitMessage(msg.wParam);
Exit();
::PostThreadMessage(::GetCurrentThreadId(), WM_QUIT, msg.wParam, msg.lParam);
return false;
} else {
// If we had UI activity we would be processing it now so we know we
// have either kUIActivity or kActivityNoUIAVail.