aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-20 14:06:35 -0500
committerTed Gould <ted@canonical.com>2009-04-20 14:06:35 -0500
commitf30fe10fea03b79da41d82f8ea276291a9624fcf (patch)
treef19b5f6e1360712ce88ebaca4376cd7f5e1b7b0b
parent8f513aa30b0b2a9bebbbdb133d329f1fc6869eba (diff)
downloadayatana-indicator-messages-f30fe10fea03b79da41d82f8ea276291a9624fcf.tar.gz
ayatana-indicator-messages-f30fe10fea03b79da41d82f8ea276291a9624fcf.tar.bz2
ayatana-indicator-messages-f30fe10fea03b79da41d82f8ea276291a9624fcf.zip
Moving signal disconnecting and unref to the dispose function instead of finalize. Fix by Cody Russell on bug 362124.
-rw-r--r--src/app-menu-item.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index 56b3ec5..d4536ac 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -119,6 +119,14 @@ app_menu_item_init (AppMenuItem *self)
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), G_CALLBACK(indicator_added_cb), self);
+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_removed_cb), self);
+
+ g_object_unref(priv->listener);
+
G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object);
}
@@ -128,11 +136,6 @@ app_menu_item_finalize (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), G_CALLBACK(indicator_added_cb), self);
- g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_removed_cb), self);
-
- g_object_unref(priv->listener);
-
G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (object);
return;