summaryrefslogtreecommitdiff
path: root/src/wx/text_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-13 13:57:28 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-14 00:42:39 +0100
commitb7e65adf286ce20918797a06a910ededf8f07b7b (patch)
tree5ae7d4b521cedc75feef7b1a03b86b2e058795ad /src/wx/text_panel.cc
parente002d31ac51e80bb1d008c198b864dfcb2b30cb3 (diff)
Use more ScopeGuards.
Diffstat (limited to 'src/wx/text_panel.cc')
-rw-r--r--src/wx/text_panel.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index 7e6557ba9..8e7d4434e 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -41,6 +41,7 @@
#include "lib/ffmpeg_content.h"
#include "lib/ffmpeg_subtitle_stream.h"
#include "lib/job_manager.h"
+#include "lib/scope_guard.h"
#include "lib/string_text_file_content.h"
#include "lib/string_text_file_decoder.h"
#include "lib/subtitle_analysis.h"
@@ -370,10 +371,10 @@ TextPanel::dcp_track_changed ()
if (_dcp_track->GetSelection() == int(_dcp_track->GetCount()) - 1) {
auto d = new DCPTextTrackDialog (this);
+ ScopeGuard sg = [d]() { d->Destroy(); };
if (d->ShowModal() == wxID_OK) {
track = d->get();
}
- d->Destroy ();
} else {
/* Find the DCPTextTrack that was selected */
for (auto i: _parent->film()->closed_caption_tracks()) {