Add wx_ptr and use it instead of ScopeGuard in a lot of places.
[dcpomatic.git] / src / wx / timing_panel.cc
index 732cd07d50a880b57aa66f4cd15fc4f3a6a7d38f..47019487f8324ed19df12dec0d0aabb86e94a968 100644 (file)
@@ -26,6 +26,7 @@
 #include "static_text.h"
 #include "timecode.h"
 #include "timing_panel.h"
+#include "wx_ptr.h"
 #include "wx_util.h"
 #include "lib/audio_content.h"
 #include "lib/content.h"
@@ -507,8 +508,7 @@ TimingPanel::move_to_start_of_reel_clicked ()
                }
        }
 
-       auto d = new MoveToDialog(this, position, _parent->film());
-       ScopeGuard sg = [d]() { d->Destroy(); };
+       auto d = make_wx<MoveToDialog>(this, position, _parent->film());
 
        if (d->ShowModal() == wxID_OK) {
                for (auto i: _parent->selected()) {