Merge lp:~ted/indicator-appmenu/lp738561 into lp:indicator-appmenu/0.3

Proposed by Ted Gould
Status: Merged
Merged at revision: 112
Proposed branch: lp:~ted/indicator-appmenu/lp738561
Merge into: lp:indicator-appmenu/0.3
Diff against target: 25 lines (+8/-0)
1 file modified
src/window-menus.c (+8/-0)
To merge this branch: bzr merge lp:~ted/indicator-appmenu/lp738561
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Approve
Review via email: mp+56251@code.launchpad.net

Description of the change

Disconnect signals as it seems this reference is living longer than expected. Probably in callbacks.

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

 review approve

Good catch!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/window-menus.c'
2--- src/window-menus.c 2011-03-08 17:10:26 +0000
3+++ src/window-menus.c 2011-04-04 19:43:27 +0000
4@@ -76,6 +76,9 @@
5 static void window_menus_init (WindowMenus *self);
6 static void window_menus_dispose (GObject *object);
7 static void root_changed (DbusmenuClient * client, DbusmenuMenuitem * new_root, gpointer user_data);
8+static void event_status (DbusmenuClient * client, DbusmenuMenuitem * mi, gchar * event, GVariant * evdata, guint timestamp, GError * error, gpointer user_data);
9+static void item_activate (DbusmenuClient * client, DbusmenuMenuitem * item, guint timestamp, gpointer user_data);
10+static void status_changed (DbusmenuClient * client, GParamSpec * pspec, gpointer user_data);
11 static void menu_entry_added (DbusmenuMenuitem * root, DbusmenuMenuitem * newentry, guint position, gpointer user_data);
12 static void menu_entry_removed (DbusmenuMenuitem * root, DbusmenuMenuitem * oldentry, gpointer user_data);
13 static void menu_entry_realized (DbusmenuMenuitem * newentry, gpointer user_data);
14@@ -231,6 +234,11 @@
15 }
16
17 if (priv->client != NULL) {
18+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->client), G_CALLBACK(root_changed), object);
19+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->client), G_CALLBACK(event_status), object);
20+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->client), G_CALLBACK(item_activate), object);
21+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->client), G_CALLBACK(status_changed), object);
22+
23 g_object_unref(G_OBJECT(priv->client));
24 priv->client = NULL;
25 }

Subscribers

People subscribed via source and target branches