[next] telepathy-glib: _tp_boxed_to_variant: return a floating ref

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Fri Feb 28 06:25:06 PST 2014


Module: telepathy-glib
Branch: next
Commit: 20775eff482eef540566711c5c2c518c0d2f5297
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=20775eff482eef540566711c5c2c518c0d2f5297

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Fri Feb 28 14:57:50 2014 +0100

_tp_boxed_to_variant: return a floating ref

---

 telepathy-glib/capabilities.c |    4 ++--
 telepathy-glib/variant-util.c |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/telepathy-glib/capabilities.c b/telepathy-glib/capabilities.c
index d3e88d9..7ba7d5d 100644
--- a/telepathy-glib/capabilities.c
+++ b/telepathy-glib/capabilities.c
@@ -185,9 +185,9 @@ tp_capabilities_set_property (GObject *object,
     {
     case PROP_CHANNEL_CLASSES:
       self->priv->classes = g_value_dup_boxed (value);
-      self->priv->classes_variant = _tp_boxed_to_variant (
+      self->priv->classes_variant = g_variant_ref_sink (_tp_boxed_to_variant (
           TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, "a(a{sv}as)",
-          self->priv->classes);
+          self->priv->classes));
       break;
 
     case PROP_CONTACT_SPECIFIC:
diff --git a/telepathy-glib/variant-util.c b/telepathy-glib/variant-util.c
index fd8ef45..a17e49b 100644
--- a/telepathy-glib/variant-util.c
+++ b/telepathy-glib/variant-util.c
@@ -61,7 +61,8 @@
 GVariant *
 tp_asv_to_vardict (const GHashTable *asv)
 {
-  return _tp_boxed_to_variant (TP_HASH_TYPE_STRING_VARIANT_MAP, "a{sv}", (gpointer) asv);
+  return g_variant_ref_sink (_tp_boxed_to_variant (
+        TP_HASH_TYPE_STRING_VARIANT_MAP, "a{sv}", (gpointer) asv));
 }
 
 GVariant *
@@ -82,7 +83,7 @@ _tp_boxed_to_variant (GType gtype,
 
   g_value_unset (&v);
 
-  return g_variant_ref_sink (ret);
+  return ret;
 }
 
 /**



More information about the telepathy-commits mailing list