telepathy-qt: tests: sync simple-channel-dispatch-operation. c from telepahty-glib

David Edmundson davidedmundson at kemper.freedesktop.org
Tue Jun 18 03:55:35 PDT 2013


Module: telepathy-qt
Branch: master
Commit: aa8c33371e1d16267d302ddbb0f52abad7686472
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=aa8c33371e1d16267d302ddbb0f52abad7686472

Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Mon Jun 17 21:21:11 2013 +0100

tests: sync simple-channel-dispatch-operation.c from telepahty-glib

This fixed a memory leak introduced in the last commit

Reviewed-by: Martin Klapetek <mklapetek at kde.org>

---

 tests/lib/glib/simple-channel-dispatch-operation.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tests/lib/glib/simple-channel-dispatch-operation.c b/tests/lib/glib/simple-channel-dispatch-operation.c
index cd727de..542b036 100644
--- a/tests/lib/glib/simple-channel-dispatch-operation.c
+++ b/tests/lib/glib/simple-channel-dispatch-operation.c
@@ -145,13 +145,22 @@ tp_tests_simple_channel_dispatch_operation_get_property (GObject *object,
         for (i = 0; i < self->priv->channels->len; i++)
           {
             TpChannel *channel = g_ptr_array_index (self->priv->channels, i);
+            GValue props_value = G_VALUE_INIT;
+            GVariant *props_variant;
+
+            /* Yay, double conversion! But this is for tests corner case */
+            props_variant = tp_channel_dup_immutable_properties (channel);
+            dbus_g_value_parse_g_variant (props_variant, &props_value);
 
             g_ptr_array_add (arr,
                 tp_value_array_build (2,
                   DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (channel),
                   TP_HASH_TYPE_STRING_VARIANT_MAP,
-                    tp_channel_dup_immutable_properties (channel),
+                      g_value_get_boxed (&props_value),
                   G_TYPE_INVALID));
+
+            g_variant_unref (props_variant);
+            g_value_unset (&props_value);
           }
 
         g_value_take_boxed (value, arr);



More information about the telepathy-commits mailing list