diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-13 13:57:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-14 00:42:39 +0100 |
| commit | b7e65adf286ce20918797a06a910ededf8f07b7b (patch) | |
| tree | 5ae7d4b521cedc75feef7b1a03b86b2e058795ad /src/wx/content_panel.cc | |
| parent | e002d31ac51e80bb1d008c198b864dfcb2b30cb3 (diff) | |
Use more ScopeGuards.
Diffstat (limited to 'src/wx/content_panel.cc')
| -rw-r--r-- | src/wx/content_panel.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index e035d1795..c18520c30 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -654,15 +654,12 @@ ContentPanel::add_folder(boost::filesystem::path folder) auto ic = dynamic_pointer_cast<ImageContent> (i); if (ic) { auto e = new ImageSequenceDialog (_splitter); - int const r = e->ShowModal(); - auto const frame_rate = e->frame_rate (); - e->Destroy (); + ScopeGuard sg = [e]() { e->Destroy(); }; - if (r != wxID_OK) { + if (e->ShowModal() != wxID_OK) { return; } - - ic->set_video_frame_rate(_film, frame_rate); + ic->set_video_frame_rate(_film, e->frame_rate()); } _film->examine_and_add_content (i); |
