projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use more ScopeGuards.
[dcpomatic.git]
/
src
/
wx
/
content_panel.cc
diff --git
a/src/wx/content_panel.cc
b/src/wx/content_panel.cc
index e035d1795a46638d0f68607785d22e7ef1fd51d4..c18520c30b4b677453372736dd78e40f0ba70d70 100644
(file)
--- 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);
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;
}
return;
}
-
- ic->set_video_frame_rate(_film, frame_rate);
+ ic->set_video_frame_rate(_film, e->frame_rate());
}
_film->examine_and_add_content (i);
}
_film->examine_and_add_content (i);