[gconf-editor] Check if the dialog has not been destroyed.



commit 2bf7b045a5085844cce40c5f7481f2509147f18f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Mar 11 02:13:37 2010 +0100

    Check if the dialog has not been destroyed.
    
    Before calling GTK+ functions on it. Fixes a crash when the user
    dismisses the dialog while the search is in place.

 src/gconf-search-dialog.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/gconf-search-dialog.c b/src/gconf-search-dialog.c
index e34b638..d033019 100644
--- a/src/gconf-search-dialog.c
+++ b/src/gconf-search-dialog.c
@@ -82,7 +82,7 @@ gconf_search_dialog_search (GtkWidget *button, GConfSearchDialog *dialog)
 
 	gchar *pattern;
 	int res;
-	
+
 	window = g_object_get_data (G_OBJECT (dialog), "editor-window");
 	gedit_output_window_clear (GEDIT_OUTPUT_WINDOW (window->output_window));
 	window->output_window_type = GCONF_EDITOR_WINDOW_OUTPUT_WINDOW_SEARCH;
@@ -103,13 +103,7 @@ gconf_search_dialog_search (GtkWidget *button, GConfSearchDialog *dialog)
 
 	g_free (pattern);
 
-	if (dialog != NULL) {
-#if 0
-		g_signal_handlers_disconnect_by_func (dialog->entry,
-						      G_CALLBACK (gconf_search_entry_changed), dialog);
-		g_signal_handlers_disconnect_by_func (dialog->search_button,
-						      G_CALLBACK (gconf_search_dialog_search), dialog);
-#endif
+	if (dialog != NULL && GTK_IS_WIDGET (dialog)) {
 		gdk_window_set_cursor (GTK_WIDGET (dialog)->window, NULL);
 		gdk_display_flush (gtk_widget_get_display (GTK_WIDGET (dialog)));
 



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