diff options
author | Ted Gould <ted@gould.cx> | 2011-01-31 11:55:39 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-01-31 11:55:39 -0600 |
commit | 591583b6e602b93399fd125da1f658146e5d717d (patch) | |
tree | 7b67483a80cda56665264294b0e69f7d93b5ee32 | |
parent | 7be86c5778e58bbe231655ed58b7597ad61f5310 (diff) | |
download | libdbusmenu-591583b6e602b93399fd125da1f658146e5d717d.tar.gz libdbusmenu-591583b6e602b93399fd125da1f658146e5d717d.tar.bz2 libdbusmenu-591583b6e602b93399fd125da1f658146e5d717d.zip |
Switching to take_children() so that we can ensure all the data remains valid
-rw-r--r-- | libdbusmenu-gtk/parser.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 5f42ed5..4941bf4 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -656,11 +656,13 @@ widget_notify_cb (GtkWidget *widget, DbusmenuMenuitem * item = DBUSMENU_MENUITEM(g_object_get_data(G_OBJECT(widget), CACHED_MENUITEM)); if (item != NULL) { - GList * children = dbusmenu_menuitem_get_children (item); - while (children != NULL) { - dbusmenu_menuitem_child_delete (item, DBUSMENU_MENUITEM(children->data)); - children = children->next; + GList * children = dbusmenu_menuitem_take_children (item); + GList * child = children; + while (child != NULL) { + g_object_unref (G_OBJECT(child->data)); + child = child->next; } + g_list_free(children); } /* Now parse new submenu. */ |