diff options
author | David Edmundson <kde@davidedmundson.co.uk> | 2013-06-17 21:21:11 +0100 |
---|---|---|
committer | David Edmundson <kde@davidedmundson.co.uk> | 2013-06-18 11:55:18 +0100 |
commit | aa8c33371e1d16267d302ddbb0f52abad7686472 (patch) | |
tree | 4d29631a6dd620190dca55c43f665ab42682e53a /tests | |
parent | 3de4dea2ca0338f7fa89b8c8f4f46c9547c89e3c (diff) |
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@kde.org>
Diffstat (limited to 'tests')
-rw-r--r-- | 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 cd727de9..542b036f 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); |