[glib/wip/menus: 29/33] GMenuModel: properly clear variables after unref
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/menus: 29/33] GMenuModel: properly clear variables after unref
- Date: Thu, 20 Oct 2011 04:42:16 +0000 (UTC)
commit 49c413b8ad43c5c4a331c39778d09434fe3abc44
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Aug 25 01:31:19 2011 -0400
GMenuModel: properly clear variables after unref
gio/gmenumodel.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gio/gmenumodel.c b/gio/gmenumodel.c
index e389e8d..cac54e3 100644
--- a/gio/gmenumodel.c
+++ b/gio/gmenumodel.c
@@ -767,7 +767,10 @@ g_menu_attribute_iter_get_next (GMenuAttributeIter *iter,
GVariant **value)
{
if (iter->priv->value)
- g_variant_unref (iter->priv->value);
+ {
+ g_variant_unref (iter->priv->value);
+ iter->priv->value = NULL;
+ }
iter->priv->valid = G_MENU_ATTRIBUTE_ITER_GET_CLASS (iter)
->get_next (iter, &iter->priv->name, &iter->priv->value);
@@ -912,7 +915,10 @@ g_menu_link_iter_get_next (GMenuLinkIter *iter,
GMenuModel **value)
{
if (iter->priv->value)
- g_object_unref (iter->priv->value);
+ {
+ g_object_unref (iter->priv->value);
+ iter->priv->value = NULL;
+ }
iter->priv->valid = G_MENU_LINK_ITER_GET_CLASS (iter)
->get_next (iter, &iter->priv->name, &iter->priv->value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]