[glib/wip/menus-rebase2: 27/64] GMenuModel: fix bug in iters
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/menus-rebase2: 27/64] GMenuModel: fix bug in iters
- Date: Fri, 18 Nov 2011 16:27:42 +0000 (UTC)
commit 4b6190cfba8fa344282622757545b7b33ec82d05
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Aug 25 00:50:02 2011 -0400
GMenuModel: fix bug in iters
gio/gmenumodel.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/gio/gmenumodel.c b/gio/gmenumodel.c
index 4391135..e389e8d 100644
--- a/gio/gmenumodel.c
+++ b/gio/gmenumodel.c
@@ -772,11 +772,14 @@ g_menu_attribute_iter_get_next (GMenuAttributeIter *iter,
iter->priv->valid = G_MENU_ATTRIBUTE_ITER_GET_CLASS (iter)
->get_next (iter, &iter->priv->name, &iter->priv->value);
- if (name)
- *name = iter->priv->name;
+ if (iter->priv->valid)
+ {
+ if (name)
+ *name = iter->priv->name;
- if (value)
- *value = g_variant_ref (iter->priv->value);
+ if (value)
+ *value = g_variant_ref (iter->priv->value);
+ }
return iter->priv->valid;
}
@@ -914,11 +917,14 @@ g_menu_link_iter_get_next (GMenuLinkIter *iter,
iter->priv->valid = G_MENU_LINK_ITER_GET_CLASS (iter)
->get_next (iter, &iter->priv->name, &iter->priv->value);
- if (name)
- *name = iter->priv->name;
+ if (iter->priv->valid)
+ {
+ if (name)
+ *name = iter->priv->name;
- if (value)
- *value = g_object_ref (iter->priv->value);
+ if (value)
+ *value = g_object_ref (iter->priv->value);
+ }
return iter->priv->valid;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]