#include "lib/player.h"
#include "lib/player_video.h"
#include "lib/ratio.h"
+#include "lib/scope_guard.h"
#include "lib/scoped_temporary.h"
#include "lib/server.h"
#include "lib/text_content.h"
}
auto c = new wxDirDialog (this, _("Select DCP to open"), d, wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
+ ScopeGuard sg = [c]() { c->Destroy(); };
int r;
while (true) {
load_dcp (dcp);
Config::instance()->set_last_player_load_directory (dcp.parent_path());
}
-
- c->Destroy ();
}
void file_add_ov ()
wxStandardPaths::Get().GetDocumentsDir(),
wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST
);
+ ScopeGuard sg = [c]() { c->Destroy(); };
int r;
while (true) {
}
}
- c->Destroy ();
_info->triggered_update ();
}
void file_add_kdm ()
{
auto d = new wxFileDialog (this, _("Select KDM"));
+ ScopeGuard sg = [d]() { d->Destroy(); };
if (d->ShowModal() == wxID_OK) {
DCPOMATIC_ASSERT (_film);
}
} catch (exception& e) {
error_dialog (this, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
- d->Destroy ();
return;
}
}
- d->Destroy ();
_info->triggered_update ();
}