[evolution] cleanup taskbar activities to remove signals with dangling pointers



commit d1c8dd596ce7b0f6a4ce9de605fd67290b5ce42c
Author: Michael Meeks <michael meeks novell com>
Date:   Sat Mar 13 22:08:42 2010 +0000

    cleanup taskbar activities to remove signals with dangling pointers

 shell/e-shell-taskbar.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c
index 53ccae6..7e8a34a 100644
--- a/shell/e-shell-taskbar.c
+++ b/shell/e-shell-taskbar.c
@@ -157,6 +157,17 @@ shell_taskbar_get_property (GObject *object,
 	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 }
 
+static gboolean
+disconnect_remove (EActivity      *activity,
+		   EActivityProxy *proxy,
+		   EShellTaskbar  *shell_taskbar)
+{
+	g_signal_handlers_disconnect_matched
+		(activity, G_SIGNAL_MATCH_DATA,
+		 0, 0, NULL, NULL, shell_taskbar);
+	return TRUE;
+}
+
 static void
 shell_taskbar_dispose (GObject *object)
 {
@@ -188,7 +199,9 @@ shell_taskbar_dispose (GObject *object)
 		priv->hbox = NULL;
 	}
 
-	g_hash_table_remove_all (priv->proxy_table);
+	g_hash_table_foreach_remove (priv->proxy_table,
+				     (GHRFunc) disconnect_remove,
+				     object);
 
 	/* Chain up to parent's dispose() method. */
 	G_OBJECT_CLASS (parent_class)->dispose (object);



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