[glib/wip/menus: 29/61] GMenuModel: properly clear variables after unref
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/menus: 29/61] GMenuModel: properly clear variables after unref
- Date: Thu, 17 Nov 2011 23:37:09 +0000 (UTC)
commit a1c5a5778aad74f3fd34537b2ff5c53fdc381299
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]