aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2011-10-05 14:59:21 -0400
committerMichael Terry <michael.terry@canonical.com>2011-10-05 14:59:21 -0400
commitfcd8e4126dea4e2fbde3a17fe842f2cd10750220 (patch)
treed092a41b2a426b159f9a458654ec8035a462eea4
parent1e2a29f24c3f28fd4d7e22ee6f0e873fbcf47e4a (diff)
downloadlibdbusmenu-fcd8e4126dea4e2fbde3a17fe842f2cd10750220.tar.gz
libdbusmenu-fcd8e4126dea4e2fbde3a17fe842f2cd10750220.tar.bz2
libdbusmenu-fcd8e4126dea4e2fbde3a17fe842f2cd10750220.zip
when resetting an image widget and it's the only child of the menuitem, make sure we don't try to use free'd memory
-rw-r--r--libdbusmenu-gtk/genericmenuitem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c
index 5488f93..ef77a2e 100644
--- a/libdbusmenu-gtk/genericmenuitem.c
+++ b/libdbusmenu-gtk/genericmenuitem.c
@@ -449,6 +449,7 @@ genericmenuitem_set_image (Genericmenuitem * menu_item, GtkWidget * image)
if (GTK_IS_IMAGE(child)) {
/* We've got a label, let's update it. */
imagew = GTK_IMAGE(child);
+ child = NULL;
} else if (GTK_IS_BOX(child)) {
/* Look for the label in the box */
gtk_container_foreach(GTK_CONTAINER(child), set_image_helper, &imagew);