[glib/wip/menus: 14/18] GMenuModel: fix bug in iters
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/menus: 14/18] GMenuModel: fix bug in iters
- Date: Sun, 9 Oct 2011 20:20:14 +0000 (UTC)
commit af2fccf0b38f0e972088a9f9d56dfb1a851875e1
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]