diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-14 22:06:05 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-14 22:06:05 +0100 |
| commit | 4e4968464eeef1956cb82392e1fc3b27a792ab89 (patch) | |
| tree | 79db245f320df21a075a0fd26de685e02fff6924 /src/wx/controls.cc | |
| parent | 0ecea9f4d1a772e99f396e47364e68abfbfe9f7f (diff) | |
Add wx_ptr and use it instead of ScopeGuard in a lot of places.
Diffstat (limited to 'src/wx/controls.cc')
| -rw-r--r-- | src/wx/controls.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 804b59dae..b9eebade5 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -28,6 +28,7 @@ #include "playhead_to_frame_dialog.h" #include "playhead_to_timecode_dialog.h" #include "static_text.h" +#include "wx_ptr.h" #include "wx_util.h" #include "lib/content_factory.h" #include "lib/cross.h" @@ -381,8 +382,7 @@ Controls::setup_sensitivity () void Controls::timecode_clicked () { - auto dialog = new PlayheadToTimecodeDialog(this, _viewer.position(), _film->video_frame_rate()); - ScopeGuard sg = [dialog]() { dialog->Destroy(); }; + auto dialog = make_wx<PlayheadToTimecodeDialog>(this, _viewer.position(), _film->video_frame_rate()); if (dialog->ShowModal() == wxID_OK) { _viewer.seek(dialog->get(), true); @@ -393,8 +393,7 @@ Controls::timecode_clicked () void Controls::frame_number_clicked () { - auto dialog = new PlayheadToFrameDialog(this, _viewer.position(), _film->video_frame_rate()); - ScopeGuard sg = [dialog]() { dialog->Destroy(); }; + auto dialog = make_wx<PlayheadToFrameDialog>(this, _viewer.position(), _film->video_frame_rate()); if (dialog->ShowModal() == wxID_OK) { _viewer.seek(dialog->get(), true); |
