diff options
author | Ted Gould <ted@gould.cx> | 2012-02-15 11:12:32 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-02-15 11:12:32 -0600 |
commit | 90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088 (patch) | |
tree | 42c2aca26c68a92a40aad2240fabef2d18b6447c /libdbusmenu-gtk/parser.c | |
parent | 4e11380a712fe09471e105b605e1f1bb285b09f9 (diff) | |
parent | 031394edac21d148926e65051149f8dc71f98b68 (diff) | |
download | libdbusmenu-90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088.tar.gz libdbusmenu-90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088.tar.bz2 libdbusmenu-90aa71ca8b1ef10d2dfad3b5f18212fc50d0c088.zip |
Fix some of the issues with throwing criticals
Diffstat (limited to 'libdbusmenu-gtk/parser.c')
-rw-r--r-- | libdbusmenu-gtk/parser.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index aefbd05..ab3b77a 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -427,8 +427,11 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse) /* Oops, let's tell our parents about us */ if (peek == NULL) { - if (dbusmenu_menuitem_get_parent(thisitem) != NULL) { - dbusmenu_menuitem_unparent(thisitem); + g_object_ref(thisitem); + + DbusmenuMenuitem * parent = dbusmenu_menuitem_get_parent(thisitem); + if (parent != NULL) { + dbusmenu_menuitem_child_delete(parent, thisitem); } gint pos = get_child_position (widget); @@ -439,6 +442,8 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse) else dbusmenu_menuitem_child_append (recurse->parent, thisitem); + + g_object_unref(thisitem); } } |