UI: Don't use "quit on last window closed"

Instead, quit only when the main window has been fully closed (and not
minimized to tray).  Fixes a bug where if the main window is minimized
to tray and another non-child window is open (for example, the stats
window), and then that window is closed, would cause the program to
prematurely exit and crash.
This commit is contained in:
jp9000 2017-05-14 13:03:46 -07:00
parent d13fa96851
commit 13741034dd
2 changed files with 4 additions and 0 deletions

View file

@ -939,6 +939,8 @@ bool OBSApp::OBSInit()
blog(LOG_INFO, "Portable mode: %s",
portable_mode ? "true" : "false");
setQuitOnLastWindowClosed(false);
mainWindow = new OBSBasic();
mainWindow->setAttribute(Qt::WA_DeleteOnClose, true);

View file

@ -2977,6 +2977,8 @@ void OBSBasic::closeEvent(QCloseEvent *event)
/* Clear all scene data (dialogs, widgets, widget sub-items, scenes,
* sources, etc) so that all references are released before shutdown */
ClearSceneData();
App()->quit();
}
void OBSBasic::changeEvent(QEvent *event)