Merge lp:~ted/libdbusmenu/lp950762 into lp:libdbusmenu/0.6

Proposed by Ted Gould on 2012-03-09
Status: Merged
Merged at revision: 384
Proposed branch: lp:~ted/libdbusmenu/lp950762
Merge into: lp:libdbusmenu/0.6
Diff against target: 41 lines (+12/-4)
1 file modified
libdbusmenu-gtk/parser.c (+12/-4)
To merge this branch: bzr merge lp:~ted/libdbusmenu/lp950762
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve on 2012-03-09
DBus Menu Team 2012-03-09 Pending
Review via email: mp+96780@code.launchpad.net

Description of the change

Removes the handler in more cases.

To post a comment you must log in.
Charles Kerr (charlesk) wrote :

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-gtk/parser.c'
2--- libdbusmenu-gtk/parser.c 2012-03-02 21:26:08 +0000
3+++ libdbusmenu-gtk/parser.c 2012-03-09 15:23:22 +0000
4@@ -229,7 +229,12 @@
5 static void
6 widget_freed (gpointer data, GObject * obj)
7 {
8- g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), obj);
9+ ParserData * pdata = (ParserData *)data;
10+
11+ if (pdata->theme_changed_sig != 0) {
12+ g_signal_handler_disconnect(gtk_icon_theme_get_default(), pdata->theme_changed_sig);
13+ pdata->theme_changed_sig = 0;
14+ }
15
16 return;
17 }
18@@ -242,9 +247,12 @@
19 ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(obj), PARSER_DATA);
20
21 if (pdata != NULL && pdata->widget != NULL) {
22- g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), pdata->widget);
23+ if (pdata->theme_changed_sig != 0) {
24+ g_signal_handler_disconnect(gtk_icon_theme_get_default(), pdata->theme_changed_sig);
25+ pdata->theme_changed_sig = 0;
26+ }
27 g_object_steal_data(G_OBJECT(pdata->widget), CACHED_MENUITEM);
28- g_object_weak_unref(G_OBJECT(pdata->widget), widget_freed, NULL);
29+ g_object_weak_unref(G_OBJECT(pdata->widget), widget_freed, pdata);
30 }
31 }
32
33@@ -286,7 +294,7 @@
34 g_object_set_data_full(G_OBJECT(item), PARSER_DATA, pdata, parse_data_free);
35
36 g_object_weak_ref(G_OBJECT(item), dbusmenu_item_freed, NULL);
37- g_object_weak_ref(G_OBJECT(widget), widget_freed, NULL);
38+ g_object_weak_ref(G_OBJECT(widget), widget_freed, pdata);
39
40 pdata->widget = widget;
41 g_object_add_weak_pointer(G_OBJECT (widget), (gpointer*)&pdata->widget);

Subscribers

People subscribed via source and target branches

to all changes: