From 1dbc6c177a565b929a1648015b6b00fbbddadc80 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 21 Dec 2021 01:45:43 -0800 Subject: [PATCH] UI: Invoke QCoreApplication::quit in queued connection Instead of calling App()->quit() directly, which may shut down the event loop prematurely, invoke it and put it in the event queue so other events can be processed first. Again, this may be redundant, but we want to make sure any remaining events are taken care of before the main window gets completely destroyed, and before the program shuts down. This should help ensure that. Plus it also says you're supposed to do it this way in the documentation rather than call it correctly so uh... yea. Probably should have done this sooner. --- UI/window-basic-main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 232c25e52..ca4db220a 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -4672,7 +4672,7 @@ void OBSBasic::closeEvent(QCloseEvent *event) if (api) api->on_event(OBS_FRONTEND_EVENT_EXIT); - App()->quit(); + QMetaObject::invokeMethod(App(), "quit", Qt::QueuedConnection); } void OBSBasic::changeEvent(QEvent *event)