summaryrefslogtreecommitdiff
path: root/src/tools/dcpomatic_player.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-14 22:06:05 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-14 22:06:05 +0100
commit4e4968464eeef1956cb82392e1fc3b27a792ab89 (patch)
tree79db245f320df21a075a0fd26de685e02fff6924 /src/tools/dcpomatic_player.cc
parent0ecea9f4d1a772e99f396e47364e68abfbfe9f7f (diff)
Add wx_ptr and use it instead of ScopeGuard in a lot of places.
Diffstat (limited to 'src/tools/dcpomatic_player.cc')
-rw-r--r--src/tools/dcpomatic_player.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 1b2b98729..600d1c6b4 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -32,6 +32,7 @@
#include "wx/update_dialog.h"
#include "wx/verify_dcp_dialog.h"
#include "wx/verify_dcp_progress_dialog.h"
+#include "wx/wx_ptr.h"
#include "wx/wx_signal_manager.h"
#include "wx/wx_util.h"
#include "lib/compose.hpp"
@@ -617,8 +618,7 @@ private:
d = std_to_wx (Config::instance()->last_player_load_directory()->string());
}
- auto c = new wxDirDialog (this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
- ScopeGuard sg = [c]() { c->Destroy(); };
+ auto c = make_wx<wxDirDialog>(this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
int r;
while (true) {
@@ -644,13 +644,12 @@ private:
initial_dir = std_to_wx(Config::instance()->last_player_load_directory()->string());
}
- auto c = new wxDirDialog (
+ auto c = make_wx<wxDirDialog>(
this,
_("Select DCP to open as OV"),
initial_dir,
wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST
);
- ScopeGuard sg = [c]() { c->Destroy(); };
int r;
while (true) {
@@ -688,8 +687,7 @@ private:
void file_add_kdm ()
{
- auto d = new wxFileDialog (this, _("Select KDM"));
- ScopeGuard sg = [d]() { d->Destroy(); };
+ auto d = make_wx<wxFileDialog>(this, _("Select KDM"));
if (d->ShowModal() == wxID_OK) {
DCPOMATIC_ASSERT (_film);