Commit 409bdaa3 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

fix crash (don't dereference dialog after it has been destroyed). Also put

2008-05-17  Michael Natterer  <mitch@gimp.org>

	* app/dialogs/file-save-dialog.c (file_save_dialog_response): fix
	crash (don't dereference dialog after it has been destroyed). Also
	put back code that sets the dialog back to sensitive if it still
	exists.


svn path=/trunk/; revision=25686
parent e8017950
2008-05-17 Michael Natterer <mitch@gimp.org>
* app/dialogs/file-save-dialog.c (file_save_dialog_response): fix
crash (don't dereference dialog after it has been destroyed). Also
put back code that sets the dialog back to sensitive if it still
exists.
2008-05-17 Michael Natterer <mitch@gimp.org> 2008-05-17 Michael Natterer <mitch@gimp.org>
* app/core/gimpimagefile.c * app/core/gimpimagefile.c
......
...@@ -121,6 +121,7 @@ file_save_dialog_response (GtkWidget *save_dialog, ...@@ -121,6 +121,7 @@ file_save_dialog_response (GtkWidget *save_dialog,
gchar *uri; gchar *uri;
gchar *basename; gchar *basename;
GimpPlugInProcedure *save_proc; GimpPlugInProcedure *save_proc;
gulong handler_id;
g_object_set_data_full (G_OBJECT (gimp), "gimp-file-save-dialog-state", g_object_set_data_full (G_OBJECT (gimp), "gimp-file-save-dialog-state",
gimp_file_dialog_get_state (dialog), gimp_file_dialog_get_state (dialog),
...@@ -135,6 +136,9 @@ file_save_dialog_response (GtkWidget *save_dialog, ...@@ -135,6 +136,9 @@ file_save_dialog_response (GtkWidget *save_dialog,
} }
gimp_file_dialog_set_sensitive (dialog, FALSE); gimp_file_dialog_set_sensitive (dialog, FALSE);
handler_id = g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&dialog);
if (file_save_dialog_check_uri (save_dialog, gimp, if (file_save_dialog_check_uri (save_dialog, gimp,
&uri, &basename, &save_proc)) &uri, &basename, &save_proc))
...@@ -151,8 +155,6 @@ file_save_dialog_response (GtkWidget *save_dialog, ...@@ -151,8 +155,6 @@ file_save_dialog_response (GtkWidget *save_dialog,
parent = gtk_window_get_transient_for (GTK_WINDOW (dialog)); parent = gtk_window_get_transient_for (GTK_WINDOW (dialog));
gtk_widget_destroy (save_dialog);
if (dialog->close_after_saving) if (dialog->close_after_saving)
{ {
if (GIMP_IS_DISPLAY_SHELL (parent)) if (GIMP_IS_DISPLAY_SHELL (parent))
...@@ -165,12 +167,20 @@ file_save_dialog_response (GtkWidget *save_dialog, ...@@ -165,12 +167,20 @@ file_save_dialog_response (GtkWidget *save_dialog,
gimp_display_close (display); gimp_display_close (display);
} }
} }
gtk_widget_destroy (save_dialog);
} }
} }
g_free (uri); g_free (uri);
g_free (basename); g_free (basename);
} }
if (dialog)
{
gimp_file_dialog_set_sensitive (dialog, TRUE);
g_signal_handler_disconnect (dialog, handler_id);
}
} }
static gboolean static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment