diff options
author | Ted Gould <ted@gould.cx> | 2010-02-09 23:34:06 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-09 23:34:06 -0600 |
commit | e92fb8d011ef38491a724b828bb83b1a63a810cb (patch) | |
tree | f1a7c103ac8fb9952c732235e5a0f140ce12d484 | |
parent | 20a6ad89877a6f0a4c279fdda313499e64ff8b5a (diff) | |
download | libdbusmenu-e92fb8d011ef38491a724b828bb83b1a63a810cb.tar.gz libdbusmenu-e92fb8d011ef38491a724b828bb83b1a63a810cb.tar.bz2 libdbusmenu-e92fb8d011ef38491a724b828bb83b1a63a810cb.zip |
Killing our children
-rw-r--r-- | libdbusmenu-glib/menuitem-proxy.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libdbusmenu-glib/menuitem-proxy.c b/libdbusmenu-glib/menuitem-proxy.c index 0bbfd26..78244d3 100644 --- a/libdbusmenu-glib/menuitem-proxy.c +++ b/libdbusmenu-glib/menuitem-proxy.c @@ -207,6 +207,13 @@ proxy_item_child_moved (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, gui return; } +/* Making g_object_unref into a GFunc */ +static void +func_g_object_unref (gpointer data, gpointer user_data) +{ + return g_object_unref(G_OBJECT(data)); +} + /* References all of the things we need for talking to this menuitem including signals and other data. If the menuitem already has properties we need to signal that they've changed for us. */ @@ -270,6 +277,9 @@ remove_menuitem (DbusmenuMenuitemProxy * pmi) priv->mi = NULL; /* Remove our own children */ + GList * children = dbusmenu_menuitem_take_children(DBUSMENU_MENUITEM(pmi)); + g_list_foreach(children, func_g_object_unref, NULL); + g_list_free(children); return; } |