Skip to content

Commit 34a0a6a

Browse files
Warchamp7RytoEX
authored andcommitted
frontend: Remove crash handler earlier in shutdown
1 parent 606e193 commit 34a0a6a

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

frontend/OBSApp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,6 @@ bool OBSApp::OBSInit()
12381238
mainWindow->setAttribute(Qt::WA_DeleteOnClose, true);
12391239

12401240
connect(QApplication::instance(), &QApplication::aboutToQuit, this, [this]() {
1241-
crashHandler_->applicationShutdownHandler();
1242-
12431241
/* Ensure OBSMainWindow gets closed */
12441242
if (mainWindow) {
12451243
mainWindow->close();
@@ -1253,6 +1251,9 @@ bool OBSApp::OBSInit()
12531251

12541252
mainWindow->OBSInit();
12551253

1254+
connect(OBSBasic::Get(), &OBSBasic::mainWindowClosed, crashHandler_.get(),
1255+
&OBS::CrashHandler::applicationShutdownHandler);
1256+
12561257
connect(this, &QGuiApplication::applicationStateChanged,
12571258
[this](Qt::ApplicationState state) { ResetHotkeyState(state == Qt::ApplicationActive); });
12581259
ResetHotkeyState(applicationState() == Qt::ApplicationActive);

frontend/data/locale/en-US.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ ConfirmBWTest.Title="Start Bandwidth Test?"
397397
ConfirmBWTest.Text="You have OBS configured in bandwidth test mode. This mode allows for network testing without your channel going live. Once you are done testing, you will need to disable it in order for viewers to be able to see your stream.\n\nDo you want to continue?"
398398

399399
# confirm exit dialog box
400-
ConfirmExit.Title="Exit OBS?"
401-
ConfirmExit.Text="OBS is currently active. All streams/recordings will be shut down. Are you sure you wish to exit?"
400+
ConfirmExit.Title="Active Outputs"
401+
ConfirmExit.Text="OBS is still currently active. All streams/recordings will be shut down."
402402

403403
# confirm delete dialog box
404404
ConfirmRemove.Title="Confirm Remove"

frontend/utility/NativeEventFilter_Windows.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *mes
4343
}
4444

4545
if (main->shouldPromptForClose()) {
46-
*result = FALSE;
46+
if (result) {
47+
*result = FALSE;
48+
}
49+
QTimer::singleShot(1, main, &OBSBasic::close);
4750
return true;
4851
}
4952

@@ -52,13 +55,6 @@ bool NativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *mes
5255
if (msg->wParam == TRUE) {
5356
// Session is ending, start closing the main window now with no checks or prompts.
5457
main->closeWindow();
55-
} else {
56-
/* Session is no longer ending. If OBS is still open, odds are it is what held
57-
* up the session end due to its higher than default priority. We call the
58-
* close method to trigger the confirmation window flow. We do this after the fact
59-
* to avoid blocking the main window event loop prior to this message.
60-
* Otherwise, OBS is already gone and invoking this does nothing. */
61-
main->close();
6258
}
6359

6460
return true;

frontend/widgets/OBSBasic.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,9 +1894,10 @@ bool OBSBasic::promptToClose()
18941894

18951895
SetShowing(true);
18961896
QMessageBox::StandardButton button =
1897-
OBSMessageBox::question(this, QTStr("ConfirmExit.Title"), QTStr("ConfirmExit.Text"));
1897+
OBSMessageBox::question(this, QTStr("ConfirmExit.Title"), QTStr("ConfirmExit.Text"),
1898+
QMessageBox::StandardButtons(QMessageBox::Ok | QMessageBox::Cancel));
18981899

1899-
if (button == QMessageBox::No) {
1900+
if (button == QMessageBox::Cancel) {
19001901
isClosePromptOpen_ = false;
19011902
return false;
19021903
}
@@ -1971,6 +1972,8 @@ void OBSBasic::closeWindow()
19711972
applicationShutdown();
19721973
deleteLater();
19731974

1975+
emit mainWindowClosed();
1976+
19741977
QMetaObject::invokeMethod(App(), "quit", Qt::QueuedConnection);
19751978
}
19761979

frontend/widgets/OBSBasic.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ public slots:
341341
virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
342342
virtual void changeEvent(QEvent *event) override;
343343

344+
signals:
345+
void mainWindowClosed();
346+
344347
/* -------------------------------------
345348
* MARK: - OAuth
346349
* -------------------------------------

0 commit comments

Comments
 (0)