GVariant: fix for g_variant_iter_loop()

This commit is contained in:
Ryan Lortie 2010-04-14 23:35:56 -04:00
parent 3349bab022
commit d17f4bee17

View File

@ -3473,17 +3473,21 @@ g_variant_valist_get (const gchar **str,
else /* tuple, dictionary entry */
{
GVariantIter iter;
gint index = 0;
g_assert (**str == '(' || **str == '{');
g_variant_iter_init (&iter, value);
(*str)++;
while (**str != ')' && **str != '}')
{
value = g_variant_iter_next_value (&iter);
g_variant_valist_get (str, value, free, app);
g_variant_unref (value);
if (value != NULL)
{
GVariant *child = g_variant_get_child_value (value, index++);
g_variant_valist_get (str, child, free, app);
g_variant_unref (child);
}
else
g_variant_valist_get (str, NULL, free, app);
}
(*str)++;
}