[nautilus-actions/gnome-2-28] Only disconnect not null signal handlers



commit af34ef53cd68eb77759069e5bc4b7b046cac30bd
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Oct 14 22:09:28 2009 +0200

    Only disconnect not null signal handlers

 ChangeLog              |    3 +++
 src/nact/nact-window.c |   10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4c5608b..bf273bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-10-14 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-window.c (instance_dispose):
+	Only disconnect not null handlers.
+
 	* src/nact/nact-main-window.c (get_selected_object):
 	Only returns an object when selection is unique.
 
diff --git a/src/nact/nact-window.c b/src/nact/nact-window.c
index 8282db4..6d7316d 100644
--- a/src/nact/nact-window.c
+++ b/src/nact/nact-window.c
@@ -63,7 +63,7 @@ typedef struct {
 	NactWindowRecordedSignal;
 
 static GObjectClass *st_parent_class = NULL;
-static gboolean      st_debug_signal_connect = FALSE;
+static gboolean      st_debug_signal_connect = TRUE;
 
 static GType    register_type( void );
 static void     class_init( NactWindowClass *klass );
@@ -193,9 +193,11 @@ instance_dispose( GObject *window )
 
 		for( is = self->private->signals ; is ; is = is->next ){
 			NactWindowRecordedSignal *str = ( NactWindowRecordedSignal * ) is->data;
-			g_signal_handler_disconnect( str->instance, str->handler_id );
-			if( st_debug_signal_connect ){
-				g_debug( "%s: disconnecting signal handler %p:%lu", thisfn, str->instance, str->handler_id );
+			if( str->instance ){
+				g_signal_handler_disconnect( str->instance, str->handler_id );
+				if( st_debug_signal_connect ){
+					g_debug( "%s: disconnecting signal handler %p:%lu", thisfn, str->instance, str->handler_id );
+				}
 			}
 			g_free( str );
 		}



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