From 4e4968464eeef1956cb82392e1fc3b27a792ab89 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 14 Jan 2023 22:06:05 +0100 Subject: Add wx_ptr and use it instead of ScopeGuard in a lot of places. --- src/wx/text_panel.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wx/text_panel.cc') diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc index 8e7d4434e..94ec8506d 100644 --- a/src/wx/text_panel.cc +++ b/src/wx/text_panel.cc @@ -32,6 +32,7 @@ #include "subtitle_appearance_dialog.h" #include "text_panel.h" #include "text_view.h" +#include "wx_ptr.h" #include "wx_util.h" #include "lib/analyse_subtitles_job.h" #include "lib/dcp_content.h" @@ -370,8 +371,7 @@ TextPanel::dcp_track_changed () optional track; if (_dcp_track->GetSelection() == int(_dcp_track->GetCount()) - 1) { - auto d = new DCPTextTrackDialog (this); - ScopeGuard sg = [d]() { d->Destroy(); }; + auto d = make_wx(this); if (d->ShowModal() == wxID_OK) { track = d->get(); } -- cgit v1.2.3