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
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2011-03-09 20:26:21 +0000
+++ libdbusmenu-glib/client.c 2011-03-10 00:46:28 +0000
@@ -1213,7 +1213,9 @@
1213 while (g_variant_iter_next(&properties, "s", &property)) {1213 while (g_variant_iter_next(&properties, "s", &property)) {
1214 /* g_debug("Removing property '%s' on %d", property, id); */1214 /* g_debug("Removing property '%s' on %d", property, id); */
1215 dbusmenu_menuitem_property_remove(menuitem, property);1215 dbusmenu_menuitem_property_remove(menuitem, property);
1216 g_free(property);
1216 }1217 }
1218 g_variant_unref(ritem);
1217 }1219 }
12181220
1219 GVariantIter items;1221 GVariantIter items;
@@ -1304,12 +1306,11 @@
1304 have_error = TRUE;1306 have_error = TRUE;
1305 }1307 }
13061308
1307 GList * current_props = NULL;1309 GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
1310 GList * tmp = NULL;
13081311
1309 for (current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));1312 for (tmp = current_props; tmp != NULL && have_error == FALSE; tmp = g_list_next(tmp)) {
1310 current_props != NULL && have_error == FALSE;1313 dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)tmp->data);
1311 current_props = g_list_next(current_props)) {
1312 dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)current_props->data);
1313 }1314 }
1314 g_list_free(current_props);1315 g_list_free(current_props);
13151316
13161317
=== modified file 'libdbusmenu-gtk/client.c'
--- libdbusmenu-gtk/client.c 2011-02-21 16:04:27 +0000
+++ libdbusmenu-gtk/client.c 2011-03-10 00:46:28 +0000
@@ -697,6 +697,7 @@
697697
698 if (gmi != NULL) {698 if (gmi != NULL) {
699 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);699 dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
700 g_object_unref(gmi);
700 } else {701 } else {
701 return FALSE;702 return FALSE;
702 }703 }
@@ -870,6 +871,9 @@
870 } else {871 } else {
871 gtk_image_set_from_pixbuf(GTK_IMAGE(gtkimage), image);872 gtk_image_set_from_pixbuf(GTK_IMAGE(gtkimage), image);
872 }873 }
874 if (image) {
875 g_object_unref(image);
876 }
873 }877 }
874878
875 }879 }
876880
=== modified file 'libdbusmenu-gtk/menuitem.c'
--- libdbusmenu-gtk/menuitem.c 2011-03-01 17:45:50 +0000
+++ libdbusmenu-gtk/menuitem.c 2011-03-10 00:46:28 +0000
@@ -119,12 +119,7 @@
119 g_error_free(error);119 g_error_free(error);
120 }120 }
121121
122 error = NULL;122 g_object_unref(input);
123 g_input_stream_close(input, NULL, &error);
124 if (error != NULL) {
125 g_warning("Unable to close input stream: %s", error->message);
126 g_error_free(error);
127 }
128 g_free(icondata);123 g_free(icondata);
129124
130 return icon;125 return icon;

Subscribers

People subscribed via source and target branches