Skip to content

Commit

Permalink
Simplify closeSupplementaryWindows for QPointer use
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards committed Sep 28, 2023
1 parent 5cf07c7 commit ae1c7e8
Showing 1 changed file with 7 additions and 28 deletions.
35 changes: 7 additions & 28 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ae1c7e8

Please sign in to comment.