Use wx_ptr more.
[dcpomatic.git] / src / wx / dir_picker_ctrl.cc
index 6c8fdd1fc3e6b48c82505c7e4278b7c428156466..34e54532e10f7bc60e3904603661abce093014aa 100644 (file)
@@ -22,6 +22,7 @@
 #include "dcpomatic_button.h"
 #include "dir_picker_ctrl.h"
 #include "static_text.h"
+#include "wx_ptr.h"
 #include "wx_util.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
@@ -83,9 +84,8 @@ DirPickerCtrl::GetPath () const
 void
 DirPickerCtrl::browse_clicked ()
 {
-       wxDirDialog* d = new wxDirDialog (this);
+       auto d = make_wx<wxDirDialog>(this);
        if (d->ShowModal () == wxID_OK) {
                SetPath (d->GetPath ());
        }
-       d->Destroy ();
 }