fix(cpn): Ignore 'Quit' event in main window on MacOS if simulator running (#2874)

Prevents app crashing on exit while the simulator is open.
This commit is contained in:
philmoz
2022-12-20 21:15:35 +10:00
committed by GitHub
parent 4841f0673c
commit af040c9e2e
3 changed files with 25 additions and 0 deletions
+8
View File
@@ -197,6 +197,14 @@ void MainWindow::displayWarnings()
void MainWindow::closeEvent(QCloseEvent *event)
{
#ifdef __APPLE__
// If simulator is running ignore this Quit event (simulator will still be closed)
// - prevents app crash on exit
if (isSimulatorRunning()) {
event->ignore();
return;
}
#endif
g.mainWinGeo(saveGeometry());
g.mainWinState(saveState());
g.tabbedMdi(actTabbedWindows->isChecked());