Merge lp:~chrisccoulson/libdbusmenu/lp722972 into lp:libdbusmenu/0.5

Proposed by Chris Coulson
Status: Merged
Approved by: Ted Gould
Approved revision: 263
Merge reported by: Ted Gould
Merged at revision: not available
Proposed branch: lp:~chrisccoulson/libdbusmenu/lp722972
Merge into: lp:libdbusmenu/0.5
Diff against target: 70 lines (+11/-11)
3 files modified
libdbusmenu-glib/client.c (+6/-5)
libdbusmenu-gtk/client.c (+4/-0)
libdbusmenu-gtk/menuitem.c (+1/-6)
To merge this branch: bzr merge lp:~chrisccoulson/libdbusmenu/lp722972
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+52786@code.launchpad.net

Description of the change

Fix various memory leaks

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

  review approve
  merge approve

Cool, thanks for the fixes. I'm a little worried about that
newitem_base one as I think that might be in the other indicators as
well... need to double check that.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-glib/client.c'
2--- libdbusmenu-glib/client.c 2011-03-09 20:26:21 +0000
3+++ libdbusmenu-glib/client.c 2011-03-10 00:46:28 +0000
4@@ -1213,7 +1213,9 @@
5 while (g_variant_iter_next(&properties, "s", &property)) {
6 /* g_debug("Removing property '%s' on %d", property, id); */
7 dbusmenu_menuitem_property_remove(menuitem, property);
8+ g_free(property);
9 }
10+ g_variant_unref(ritem);
11 }
12
13 GVariantIter items;
14@@ -1304,12 +1306,11 @@
15 have_error = TRUE;
16 }
17
18- GList * current_props = NULL;
19+ GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
20+ GList * tmp = NULL;
21
22- for (current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
23- current_props != NULL && have_error == FALSE;
24- current_props = g_list_next(current_props)) {
25- dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)current_props->data);
26+ for (tmp = current_props; tmp != NULL && have_error == FALSE; tmp = g_list_next(tmp)) {
27+ dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)tmp->data);
28 }
29 g_list_free(current_props);
30
31
32=== modified file 'libdbusmenu-gtk/client.c'
33--- libdbusmenu-gtk/client.c 2011-02-21 16:04:27 +0000
34+++ libdbusmenu-gtk/client.c 2011-03-10 00:46:28 +0000
35@@ -697,6 +697,7 @@
36
37 if (gmi != NULL) {
38 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
39+ g_object_unref(gmi);
40 } else {
41 return FALSE;
42 }
43@@ -870,6 +871,9 @@
44 } else {
45 gtk_image_set_from_pixbuf(GTK_IMAGE(gtkimage), image);
46 }
47+ if (image) {
48+ g_object_unref(image);
49+ }
50 }
51
52 }
53
54=== modified file 'libdbusmenu-gtk/menuitem.c'
55--- libdbusmenu-gtk/menuitem.c 2011-03-01 17:45:50 +0000
56+++ libdbusmenu-gtk/menuitem.c 2011-03-10 00:46:28 +0000
57@@ -119,12 +119,7 @@
58 g_error_free(error);
59 }
60
61- error = NULL;
62- g_input_stream_close(input, NULL, &error);
63- if (error != NULL) {
64- g_warning("Unable to close input stream: %s", error->message);
65- g_error_free(error);
66- }
67+ g_object_unref(input);
68 g_free(icondata);
69
70 return icon;

Subscribers

People subscribed via source and target branches