From 13741034dd0b68dc46e7d8e39bf204a49d960645 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 14 May 2017 13:03:46 -0700 Subject: [PATCH] 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. --- UI/obs-app.cpp | 2 ++ UI/window-basic-main.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 67b4c0fed..a8813f91c 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -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); diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index edcb991de..4d12e8196 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -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)