projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84107d8
)
Cleanup: use ScopeGuard.
author
Carl Hetherington
<cth@carlh.net>
Mon, 5 Dec 2022 19:50:16 +0000
(20:50 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Mon, 5 Dec 2022 19:50:16 +0000
(20:50 +0100)
src/wx/content_panel.cc
patch
|
blob
|
history
diff --git
a/src/wx/content_panel.cc
b/src/wx/content_panel.cc
index b2b9f04c6bff4d36fa735102917a1240b50e4ec4..3dde85b43cd0420b2dd96c35d86311e6586754de 100644
(file)
--- a/
src/wx/content_panel.cc
+++ b/
src/wx/content_panel.cc
@@
-674,14
+674,13
@@
void
ContentPanel::add_dcp_clicked ()
{
auto d = new wxDirDialog (_splitter, _("Choose a DCP folder"), wxT(""), wxDD_DIR_MUST_EXIST);
+ ScopeGuard sg = [d]() { d->Destroy(); };
int r = d->ShowModal ();
- boost::filesystem::path const path (wx_to_std (d->GetPath ()));
- d->Destroy ();
-
if (r != wxID_OK) {
return;
}
+ boost::filesystem::path const path(wx_to_std(d->GetPath()));
add_dcp(path);
}