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.
This commit is contained in:
jp9000 2021-12-21 01:45:43 -08:00
parent 8bff191b32
commit 1dbc6c177a

View file

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