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/editable_list.h | |
| parent | 0ecea9f4d1a772e99f396e47364e68abfbfe9f7f (diff) | |
Add wx_ptr and use it instead of ScopeGuard in a lot of places.
Diffstat (limited to 'src/wx/editable_list.h')
| -rw-r--r-- | src/wx/editable_list.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h index f3a0dd957..f8050cac5 100644 --- a/src/wx/editable_list.h +++ b/src/wx/editable_list.h @@ -24,8 +24,8 @@ #include "dcpomatic_button.h" +#include "wx_ptr.h" #include "wx_util.h" -#include "lib/scope_guard.h" #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS #include <wx/listctrl.h> @@ -233,8 +233,7 @@ private: void add_clicked () { - S* dialog = new S (this); - ScopeGuard sg = [dialog]() { dialog->Destroy(); }; + auto dialog = make_wx<S>(this); if (dialog->ShowModal() == wxID_OK) { auto const v = dialog->get (); @@ -258,8 +257,7 @@ private: std::vector<T> all = _get (); DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ())); - S* dialog = new S (this); - ScopeGuard sg = [dialog]() { dialog->Destroy(); }; + auto dialog = make_wx<S>(this); dialog->set (all[item]); if (dialog->ShowModal() == wxID_OK) { auto const v = dialog->get (); |
