summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-27 13:41:49 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-27 13:41:49 +0100
commit7aab34abcab28ca38a5354dec075b56d430e82db (patch)
treea7a02355bb4ea08cdf652ccb89b4ee6d1247b5dd /src/tools
parent526829ad670c19d5466555890d8afe8d7f744834 (diff)
More stack-allocated Dialog objects.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic_editor.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tools/dcpomatic_editor.cc b/src/tools/dcpomatic_editor.cc
index 8e306551f..663eb8e3b 100644
--- a/src/tools/dcpomatic_editor.cc
+++ b/src/tools/dcpomatic_editor.cc
@@ -362,12 +362,12 @@ private:
void file_open ()
{
auto d = wxStandardPaths::Get().GetDocumentsDir();
- auto c = new wxDirDialog (this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
+ wxDirDialog dialog(this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
int r;
while (true) {
- r = c->ShowModal ();
- if (r == wxID_OK && c->GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
+ r = dialog.ShowModal();
+ if (r == wxID_OK && dialog.GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
error_dialog (this, _("You did not select a folder. Make sure that you select a folder before clicking Open."));
} else {
break;
@@ -375,11 +375,9 @@ private:
}
if (r == wxID_OK) {
- boost::filesystem::path const dcp (wx_to_std (c->GetPath ()));
+ boost::filesystem::path const dcp(wx_to_std(dialog.GetPath()));
load_dcp (dcp);
}
-
- c->Destroy ();
}
void file_save ()
@@ -394,9 +392,8 @@ private:
void help_about ()
{
- auto d = new AboutDialog (this);
- d->ShowModal ();
- d->Destroy ();
+ AboutDialog dialog(this);
+ dialog.ShowModal();
}
wxPanel* _overall_panel = nullptr;