diff options
author | Ted Gould <ted@gould.cx> | 2011-01-27 14:12:16 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-01-27 14:12:16 -0600 |
commit | b3088525e0497a660667dc4069554274e95ec498 (patch) | |
tree | 907dd3c614e08e4ab107b44ae3ce7c5ca874c185 /libdbusmenu-glib/menuitem.c | |
parent | 3393d799cd65efdfea2c882b775e58f15a205844 (diff) | |
parent | db78a405701a56b3df9359293dd944a5d7b8bbe7 (diff) | |
download | libdbusmenu-b3088525e0497a660667dc4069554274e95ec498.tar.gz libdbusmenu-b3088525e0497a660667dc4069554274e95ec498.tar.bz2 libdbusmenu-b3088525e0497a660667dc4069554274e95ec498.zip |
* Upstream Merge
* Fixing setting toggle to a boolean
* Fixing some memory leaks
* Fixing signatures in GetChildren
* Look for the serializable menuitems and use their
build functions
* Fix critical message from being printed
* Fixing shutdown messages on destruction
* Adding a parser
* Adding a serializable menu item
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 827d6c5..b40195c 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1204,11 +1204,17 @@ dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi) return g_hash_table_get_keys(priv->properties); } +/* Copy the keys and make references to the variants that are + in the new table. They'll be free'd and unref'd when the + Hashtable gets destroyed. */ static void copy_helper (gpointer in_key, gpointer in_value, gpointer in_data) { GHashTable * table = (GHashTable *)in_data; - g_hash_table_insert(table, in_key, in_value); + gchar * key = (gchar *)in_key; + GVariant * value = (GVariant *)in_value; + g_variant_ref(value); + g_hash_table_insert(table, g_strdup(key), value); return; } @@ -1229,7 +1235,7 @@ copy_helper (gpointer in_key, gpointer in_value, gpointer in_data) GHashTable * dbusmenu_menuitem_properties_copy (DbusmenuMenuitem * mi) { - GHashTable * ret = g_hash_table_new(g_str_hash, g_str_equal); + GHashTable * ret = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, _g_variant_unref); g_return_val_if_fail(DBUSMENU_IS_MENUITEM(mi), ret); |