[empathy] empathy_tp_call_leave: allocate the array on the stack



commit 6101ab6b84beb8a9e19527a2416e0e6fcd6438c1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Mar 30 13:30:41 2010 +0200

    empathy_tp_call_leave: allocate the array on the stack

 libempathy/empathy-tp-call.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c
index eafeead..30ba27d 100644
--- a/libempathy/empathy-tp-call.c
+++ b/libempathy/empathy-tp-call.c
@@ -837,7 +837,7 @@ empathy_tp_call_leave (EmpathyTpCall *self)
 {
   EmpathyTpCallPriv *priv = GET_PRIV (self);
   TpHandle self_handle;
-  GArray *array;
+  GArray array = { &self_handle, 1 };
 
   if (!tp_proxy_has_interface_by_id (priv->channel,
         TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP))
@@ -854,11 +854,6 @@ empathy_tp_call_leave (EmpathyTpCall *self)
       return;
     }
 
-  array = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1);
-  g_array_insert_val (array, 0, self_handle);
-
-  tp_cli_channel_interface_group_call_remove_members (priv->channel, -1, array,
+  tp_cli_channel_interface_group_call_remove_members (priv->channel, -1, &array,
       "", leave_remove_members_cb, self, NULL, G_OBJECT (self));
-
-  g_array_free (array, TRUE);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]