diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/content_panel.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index b2b9f04c6..3dde85b43 100644 --- 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); } |
