gimp r25686 - in trunk: . app/dialogs



Author: mitch
Date: Sat May 17 14:07:25 2008
New Revision: 25686
URL: http://svn.gnome.org/viewvc/gimp?rev=25686&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/app/dialogs/file-save-dialog.c

Modified: trunk/app/dialogs/file-save-dialog.c
==============================================================================
--- trunk/app/dialogs/file-save-dialog.c	(original)
+++ trunk/app/dialogs/file-save-dialog.c	Sat May 17 14:07:25 2008
@@ -121,6 +121,7 @@
   gchar               *uri;
   gchar               *basename;
   GimpPlugInProcedure *save_proc;
+  gulong               handler_id;
 
   g_object_set_data_full (G_OBJECT (gimp), "gimp-file-save-dialog-state",
                           gimp_file_dialog_get_state (dialog),
@@ -135,6 +136,9 @@
     }
 
   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,
                                   &uri, &basename, &save_proc))
@@ -151,8 +155,6 @@
 
               parent = gtk_window_get_transient_for (GTK_WINDOW (dialog));
 
-              gtk_widget_destroy (save_dialog);
-
               if (dialog->close_after_saving)
                 {
                   if (GIMP_IS_DISPLAY_SHELL (parent))
@@ -165,12 +167,20 @@
                         gimp_display_close (display);
                     }
                 }
+
+              gtk_widget_destroy (save_dialog);
             }
         }
 
       g_free (uri);
       g_free (basename);
     }
+
+  if (dialog)
+    {
+      gimp_file_dialog_set_sensitive (dialog, TRUE);
+      g_signal_handler_disconnect (dialog, handler_id);
+    }
 }
 
 static gboolean



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]