diff options
-rw-r--r-- | libdbusmenu-glib/client.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 2976436..5aae810 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1336,19 +1336,16 @@ menuitem_get_properties_cb (GVariant * properties, GError * error, gpointer data return; } - GVariantIter * iter = g_variant_iter_new(properties); + GVariantIter iter; gchar * key; GVariant * value; - while (g_variant_iter_next(iter, "{sv}", &key, &value)) { - dbusmenu_menuitem_property_set_variant(item, key, value); + g_variant_iter_init(&iter, properties); - g_variant_unref(value); - g_free(key); + while (g_variant_iter_loop(&iter, "{sv}", &key, &value)) { + dbusmenu_menuitem_property_set_variant(item, key, value); } - g_variant_iter_free(iter); - g_object_unref(data); return; |