diff --git a/main.c b/main.c index 3afd344..c0cc8b6 100644 --- a/main.c +++ b/main.c @@ -189,7 +189,6 @@ static void on_convert_clicked(gpointer button, gpointer user) dialog = gtk_file_chooser_dialog_new("Save TeX File", GTK_WINDOW(data->main_window), GTK_FILE_CHOOSER_ACTION_SAVE, "Cancel", GTK_RESPONSE_CANCEL, "Save", GTK_RESPONSE_ACCEPT, NULL); res = gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); if (res == GTK_RESPONSE_ACCEPT) { file_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); tex_file = fopen(file_name, "w"); @@ -199,6 +198,7 @@ static void on_convert_clicked(gpointer button, gpointer user) fclose(tex_file); } + gtk_widget_destroy(dialog); g_list_free_full(layer_list, (GDestroyNotify)delete_layer_info_struct); }