[Pkg-telepathy-commits] [telepathy-glib-1] 191/212: Fix some confusion over "&s" in variant-building

Simon McVittie smcv at debian.org
Wed May 14 12:09:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib-1.

commit c97f4aede4e5c69ec3189413a2afd88230ca48e1
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Apr 16 17:22:58 2014 +0100

    Fix some confusion over "&s" in variant-building
    
    In C-to-GVariant conversions, "&s" does not mean "take ownership";
    neither does it mean "assume statically-allocated, avoid copying
    or freeing". It is in fact exactly equivalent to "s" - i.e.
    "copy this string into the variant" - so use the simpler form instead.
    
    Reviewed-by: Xavier Claessens <xavier.claessens at collabora.com>
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
---
 telepathy-glib/base-connection.c   | 3 ++-
 telepathy-glib/base-contact-list.c | 3 ++-
 telepathy-glib/handle-set.c        | 4 +---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 0087d4d..11d6d86 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -821,8 +821,9 @@ manager_get_channel_details_foreach (TpBaseChannel *chan,
       "channel-properties", &properties,
       NULL);
 
-  g_variant_builder_add (builder, "(&o at a{sv})", object_path, properties);
+  g_variant_builder_add (builder, "(o at a{sv})", object_path, properties);
   g_variant_unref (properties);
+  g_free (object_path);
 }
 
 static void
diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c
index 4564183..79bd6b9 100644
--- a/telepathy-glib/base-contact-list.c
+++ b/telepathy-glib/base-contact-list.c
@@ -1165,11 +1165,12 @@ tp_base_contact_list_contacts_changed_internal (TpBaseContactList *self,
           _tp_base_contact_list_presence_state_to_letter (publish),
           publish_request);
 
-      g_variant_builder_add (&changes, "{u(uu&s)}", contact, subscribe,
+      g_variant_builder_add (&changes, "{u(uus)}", contact, subscribe,
           publish, publish_request);
       g_variant_builder_add (&change_ids, "{us}", contact,
           tp_handle_inspect (self->priv->contact_repo, contact));
       emit_signal = TRUE;
+      g_free (publish_request);
     }
 
   if (removed != NULL)
diff --git a/telepathy-glib/handle-set.c b/telepathy-glib/handle-set.c
index 3ccdb49..ac91cda 100644
--- a/telepathy-glib/handle-set.c
+++ b/telepathy-glib/handle-set.c
@@ -322,9 +322,7 @@ tp_handle_set_to_identifier_map (
         }
       else
         {
-          /* We don't bother dupping the strings: they remain valid as long as
-           * the connection's alive and hence the repo exists. */
-          g_variant_builder_add (&builder, "{u&s}", handle,
+          g_variant_builder_add (&builder, "{us}", handle,
               tp_handle_inspect (self->repo, handle));
         }
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git



More information about the Pkg-telepathy-commits mailing list