Don't destroy wxFileDialog before reading from it.
authorCarl Hetherington <cth@carlh.net>
Tue, 26 Nov 2013 00:11:54 +0000 (00:11 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 26 Nov 2013 00:11:54 +0000 (00:11 +0000)
src/wx/film_editor.cc

index b3b5242b2c4400653c3058ff455e4469b920e1de..6a2aea18d0655d6cc36f163b09e238a0adf10b25 100644 (file)
@@ -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