Merge lp:~dbusmenu-team/libdbusmenu/ubuntu into lp:~ubuntu-desktop/libdbusmenu/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~dbusmenu-team/libdbusmenu/ubuntu
Merge into: lp:~ubuntu-desktop/libdbusmenu/ubuntu
Diff against target: 162 lines (+26/-12)
3 files modified
debian/changelog (+11/-0)
libdbusmenu-glib/client.c (+13/-10)
libdbusmenu-glib/menuitem.c (+2/-2)
To merge this branch: bzr merge lp:~dbusmenu-team/libdbusmenu/ubuntu
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+23614@code.launchpad.net

Description of the change

I don't think these have been filled yet. :) (actually ahead of users) But, it's most noticible when you kill indicator-messages-services there's a duplication in the menu. And you can get a crash in some instances with the attribute update async stuff.

To post a comment you must log in.
lp:~dbusmenu-team/libdbusmenu/ubuntu updated
74. By Sebastien Bacher

releasing version 0.2.9-0ubuntu3

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-04-15 09:06:32 +0000
3+++ debian/changelog 2010-04-17 18:16:21 +0000
4@@ -1,3 +1,14 @@
5+libdbusmenu (0.2.9-0ubuntu3~ppa1) lucid; urgency=low
6+
7+ * Upstream Merge
8+ * Only unref root if the root has changed.
9+ * Ensure that callbacks retain references to objects incase
10+ they get deleted quickly.
11+ * Protecting references before signalling
12+ * Decrementing refs when added to child menus
13+
14+ -- Ted Gould <ted@ubuntu.com> Sat, 17 Apr 2010 13:09:57 -0500
15+
16 libdbusmenu (0.2.9-0ubuntu2) lucid; urgency=low
17
18 * Upstream Merge
19
20=== modified file 'libdbusmenu-glib/client.c'
21--- libdbusmenu-glib/client.c 2010-04-15 04:53:11 +0000
22+++ libdbusmenu-glib/client.c 2010-04-17 18:16:21 +0000
23@@ -367,6 +367,7 @@
24
25 gchar * properties[1] = {NULL}; /* This gets them all */
26 g_debug("Getting properties");
27+ g_object_ref(menuitem);
28 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_cb, menuitem);
29 return;
30 }
31@@ -574,10 +575,12 @@
32 g_return_if_fail(DBUSMENU_IS_MENUITEM(data));
33 if (error != NULL) {
34 g_warning("Error getting properties on a menuitem: %s", error->message);
35+ g_object_unref(data);
36 return;
37 }
38 g_hash_table_foreach(properties, get_properties_helper, data);
39 g_hash_table_destroy(properties);
40+ g_object_unref(data);
41 return;
42 }
43
44@@ -606,6 +609,8 @@
45
46 if (!have_error) {
47 menuitem_get_properties_cb(proxy, properties, error, data);
48+ } else {
49+ g_object_unref(data);
50 }
51
52 return;
53@@ -618,6 +623,7 @@
54 {
55 if (error != NULL) {
56 g_warning("Error getting properties on a new menuitem: %s", error->message);
57+ g_object_unref(data);
58 return;
59 }
60 g_return_if_fail(data != NULL);
61@@ -625,6 +631,7 @@
62 newItemPropData * propdata = (newItemPropData *)data;
63 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(propdata->client);
64
65+ g_object_ref(propdata->item);
66 menuitem_get_properties_cb (proxy, properties, error, propdata->item);
67
68 gboolean handled = FALSE;
69@@ -652,6 +659,7 @@
70 g_signal_emit(G_OBJECT(propdata->client), signals[NEW_MENUITEM], 0, propdata->item, TRUE);
71 }
72
73+ g_object_unref(propdata->item);
74 g_free(propdata);
75
76 return;
77@@ -749,8 +757,6 @@
78 if (parent != NULL) {
79 dbusmenu_menuitem_child_delete(parent, item);
80 }
81- /* XXX: Should this be an unref? Who's reffing this that it exists without a parent? */
82- g_object_unref(G_OBJECT(item));
83 item = NULL;
84 }
85
86@@ -769,6 +775,7 @@
87 propdata->parent = parent;
88
89 gchar * properties[1] = {NULL}; /* This gets them all */
90+ g_object_ref(item);
91 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_new_cb, propdata);
92 } else {
93 g_warning("Unable to allocate memory to get properties for menuitem. This menuitem will never be realized.");
94@@ -777,6 +784,7 @@
95 /* Refresh the properties */
96 /* XXX: We shouldn't need to get the properties everytime we reuse an entry */
97 gchar * properties[1] = {NULL}; /* This gets them all */
98+ g_object_ref(item);
99 org_ayatana_dbusmenu_get_properties_async(proxy, id, (const gchar **)properties, menuitem_get_properties_replace_cb, item);
100 }
101
102@@ -810,6 +818,7 @@
103 dbusmenu_menuitem_child_delete(item, childmi);
104 }
105 dbusmenu_menuitem_child_add_position(item, newchildmi, position);
106+ g_object_unref(newchildmi);
107 } else {
108 dbusmenu_menuitem_child_reorder(item, childmi, position);
109 }
110@@ -847,9 +856,6 @@
111 xmlNodePtr root = xmlDocGetRootElement(xmldoc);
112
113 DbusmenuMenuitem * oldroot = priv->root;
114- if (oldroot != NULL) {
115- g_object_ref(oldroot);
116- }
117
118 priv->root = parse_layout_xml(client, root, priv->root, NULL, priv->menuproxy);
119 xmlFreeDoc(xmldoc);
120@@ -867,17 +873,14 @@
121 clean up that old root */
122 if (oldroot != NULL) {
123 dbusmenu_menuitem_set_root(oldroot, FALSE);
124+ g_object_unref(oldroot);
125+ oldroot = NULL;
126 }
127
128 /* If the root changed we can signal that */
129 g_signal_emit(G_OBJECT(client), signals[ROOT_CHANGED], 0, priv->root, TRUE);
130 }
131
132- /* We need to unref it in this function no matter */
133- if (oldroot != NULL) {
134- g_object_unref(oldroot);
135- }
136-
137 return 1;
138 }
139
140
141=== modified file 'libdbusmenu-glib/menuitem.c'
142--- libdbusmenu-glib/menuitem.c 2010-04-15 04:47:01 +0000
143+++ libdbusmenu-glib/menuitem.c 2010-04-17 18:16:21 +0000
144@@ -491,8 +491,8 @@
145 #ifdef MASSIVEDEBUGGING
146 g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(user_data), LABEL(user_data), ID(data), LABEL(data));
147 #endif
148+ g_signal_emit(G_OBJECT(user_data), signals[CHILD_REMOVED], 0, DBUSMENU_MENUITEM(data), TRUE);
149 g_object_unref(G_OBJECT(data));
150- g_signal_emit(G_OBJECT(user_data), signals[CHILD_REMOVED], 0, DBUSMENU_MENUITEM(data), TRUE);
151 return;
152 }
153
154@@ -681,8 +681,8 @@
155 #ifdef MASSIVEDEBUGGING
156 g_debug("Menuitem %d (%s) signalling child removed %d (%s)", ID(mi), LABEL(mi), ID(child), LABEL(child));
157 #endif
158+ g_signal_emit(G_OBJECT(mi), signals[CHILD_REMOVED], 0, child, TRUE);
159 g_object_unref(G_OBJECT(child));
160- g_signal_emit(G_OBJECT(mi), signals[CHILD_REMOVED], 0, child, TRUE);
161 return TRUE;
162 }
163

Subscribers

People subscribed via source and target branches

to all changes: