summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-26 00:11:54 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-26 00:11:54 +0000
commit247b3423fcea1d4d20d797b48cdbaafa8dad1ea1 (patch)
treebd39a944112d72565c4438d8ea39f7c93cb975bd
parent984921524ed4a558b5bcf0a880f6585d1f14f2f9 (diff)
Don't destroy wxFileDialog before reading from it.
-rw-r--r--src/wx/film_editor.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index b3b5242b2..6a2aea18d 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -733,9 +733,9 @@ FilmEditor::content_add_file_clicked ()
{
wxFileDialog* d = new wxFileDialog (this, _("Choose a file or files"), wxT (""), wxT (""), wxT ("*.*"), wxFD_MULTIPLE);
int const r = d->ShowModal ();
- d->Destroy ();
if (r != wxID_OK) {
+ d->Destroy ();
return;
}
@@ -747,6 +747,8 @@ FilmEditor::content_add_file_clicked ()
for (unsigned int i = 0; i < paths.GetCount(); ++i) {
_film->examine_and_add_content (content_factory (_film, wx_to_std (d->GetPath ())));
}
+
+ d->Destroy ();
}
void