From ae1c7e8d9a7b65963eceee9472bfb2f2fb9cf68c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 28 Sep 2023 19:47:50 -0400 Subject: [PATCH] Simplify closeSupplementaryWindows for QPointer use --- src/mainwindow.cpp | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2a3b2735..ed6b9432 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2833,34 +2833,13 @@ bool MainWindow::initRegionMapEditor(bool silent) { } void MainWindow::closeSupplementaryWindows() { - if (this->tilesetEditor) { - delete this->tilesetEditor; - this->tilesetEditor = nullptr; - } - if (this->regionMapEditor) { - delete this->regionMapEditor; - this->regionMapEditor = nullptr; - } - if (this->mapImageExporter) { - delete this->mapImageExporter; - this->mapImageExporter = nullptr; - } - if (this->newMapPrompt) { - delete this->newMapPrompt; - this->newMapPrompt = nullptr; - } - if (this->shortcutsEditor) { - delete this->shortcutsEditor; - this->shortcutsEditor = nullptr; - } - if (this->projectSettingsEditor) { - delete this->projectSettingsEditor; - this->projectSettingsEditor = nullptr; - } - if (this->customScriptsEditor) { - delete this->customScriptsEditor; - this->customScriptsEditor = nullptr; - } + delete this->tilesetEditor; + delete this->regionMapEditor; + delete this->mapImageExporter; + delete this->newMapPrompt; + delete this->shortcutsEditor; + delete this->projectSettingsEditor; + delete this->customScriptsEditor; } void MainWindow::closeEvent(QCloseEvent *event) {