aboutsummaryrefslogtreecommitdiff
path: root/src/app-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-03-15 10:46:33 -0500
committerTed Gould <ted@canonical.com>2009-03-15 10:46:33 -0500
commit34c84145647ea961ab5fc32f03b34742b3f3a129 (patch)
tree6837485ebd922360d0abf58dc9454dbdc11d1e96 /src/app-menu-item.c
parente527f992ac9276a22a680cda881e80ed70c9f73f (diff)
downloadayatana-indicator-messages-34c84145647ea961ab5fc32f03b34742b3f3a129.tar.gz
ayatana-indicator-messages-34c84145647ea961ab5fc32f03b34742b3f3a129.tar.bz2
ayatana-indicator-messages-34c84145647ea961ab5fc32f03b34742b3f3a129.zip
Disconnecting our signals properly, avoids a crash
Diffstat (limited to 'src/app-menu-item.c')
-rw-r--r--src/app-menu-item.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index 9923075..0d5fb85 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -118,6 +118,14 @@ static void
app_menu_item_finalize (GObject *object)
{
G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (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);
+
+ return;
}
AppMenuItem *
@@ -131,7 +139,7 @@ app_menu_item_new (IndicateListener * listener, IndicateListenerServer * server)
priv->server = server;
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_added_cb), self);
+ g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed_cb), self);
priv->name = gtk_label_new(INDICATE_LISTENER_SERVER_DBUS_NAME(server));
gtk_misc_set_alignment(GTK_MISC(priv->name), 0.0, 0.5);