aboutsummaryrefslogtreecommitdiff
path: root/src/app-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-20 14:04:36 -0500
committerTed Gould <ted@canonical.com>2009-04-20 14:04:36 -0500
commit8f513aa30b0b2a9bebbbdb133d329f1fc6869eba (patch)
treedc744f3209ce7fd714ffb803bbf42e9f3f6333fe /src/app-menu-item.c
parentd84f15b0358c213ceba4beebfe9777cc37db8b00 (diff)
downloadayatana-indicator-messages-8f513aa30b0b2a9bebbbdb133d329f1fc6869eba.tar.gz
ayatana-indicator-messages-8f513aa30b0b2a9bebbbdb133d329f1fc6869eba.tar.bz2
ayatana-indicator-messages-8f513aa30b0b2a9bebbbdb133d329f1fc6869eba.zip
Adding a ref'ing and deref'ing of the listener to the application menu item to ensure it stays around while we hav signals attached to it. Fix by Code Russell on bug 362124.
Diffstat (limited to 'src/app-menu-item.c')
-rw-r--r--src/app-menu-item.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index c769d47..56b3ec5 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -131,6 +131,8 @@ app_menu_item_finalize (GObject *object)
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;
@@ -144,7 +146,9 @@ app_menu_item_new (IndicateListener * listener, IndicateListenerServer * server)
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
priv->listener = listener;
+ g_object_ref(G_OBJECT(listener));
priv->server = server;
+ /* Can not ref as not real GObject */
g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added_cb), self);
g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed_cb), self);