← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~ted/indicator-messages/count-changed-signal into lp:indicator-messages

 

Ted Gould has proposed merging lp:~ted/indicator-messages/count-changed-signal into lp:indicator-messages.

    Requested reviews:
    Indicator Applet Developers (indicator-applet-developers)


Disconnects a signal when the item is destroyed.  Stupid dereffing
objects actually working now and creating issues.

-- 
https://code.launchpad.net/~ted/indicator-messages/count-changed-signal/+merge/18947
Your team ayatana-commits is subscribed to branch lp:indicator-messages.
=== modified file 'src/app-menu-item.c'
--- src/app-menu-item.c	2010-02-09 03:51:17 +0000
+++ src/app-menu-item.c	2010-02-09 19:40:26 +0000
@@ -110,17 +110,21 @@
 	return;
 }
 
+/* Disconnect the count_changed signal and unref the listener */
 static void
 app_menu_item_dispose (GObject *object)
 {
 	AppMenuItem * self = APP_MENU_ITEM(object);
 	AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
 
+	g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), count_changed, self);
 	g_object_unref(priv->listener);
 
 	G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object);
 }
 
+/* Free the memory used by our type, desktop file and application
+   info structures. */
 static void
 app_menu_item_finalize (GObject *object)
 {


Follow ups