GTK: fixed segfault when exiting GetFilename dialog

This commit is contained in:
punkrockguy318 2010-03-07 08:07:49 +00:00
parent e5000960a3
commit 7189095a37
1 changed files with 3 additions and 2 deletions

View File

@ -246,12 +246,13 @@ std::string GetFilename(const char* title, bool save, const char* filter)
// TODO: make file filters case insensitive
//gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterX);
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser), filterAll);
gtk_dialog_run (GTK_DIALOG (fileChooser));
int response = gtk_dialog_run (GTK_DIALOG (fileChooser));
// flush gtk events
while(gtk_events_pending())
gtk_main_iteration_do(TRUE);
if (response == GTK_RESPONSE_ACCEPT)
fname = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
gtk_widget_destroy (fileChooser);