diff options
author | Vivek Dasmohapatra <vivek@collabora.co.uk> | 2011-06-08 18:40:25 +0100 |
---|---|---|
committer | Vivek Dasmohapatra <vivek@collabora.co.uk> | 2011-06-08 18:40:25 +0100 |
commit | 07e875ab4a41add247b4127470be6e45a3530e82 (patch) | |
tree | 2e78e51ad6a131111dcfaaedfda9022e3e56c219 | |
parent | feed5e78989b49983bb9231e5340ec021fc09dc8 (diff) | |
download | telepathy-mission-control-07e875ab4a41add247b4127470be6e45a3530e82.tar.gz |
Unref wrapper not required if we set the free func
-rw-r--r-- | src/mcd-dispatch-operation.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c index 14e7560f..a2b60666 100644 --- a/src/mcd-dispatch-operation.c +++ b/src/mcd-dispatch-operation.c @@ -1978,17 +1978,6 @@ observe_channels_cb (TpClient *proxy, const GError *error, _mcd_dispatch_operation_dec_observers_pending (self, MCD_CLIENT_PROXY (proxy)); } -static void -free_satisfied_requests (GPtrArray *requests) -{ - guint i; - - for (i = 0; i < requests->len; i++) - g_free (g_ptr_array_index (requests, i)); - - g_ptr_array_unref (requests); -} - /* * @paths_out: (out) (transfer container) (element-type utf8): * Requests_Satisfied @@ -2020,6 +2009,8 @@ collect_satisfied_requests (const GList *channels, } satisfied_requests = g_ptr_array_sized_new (g_hash_table_size (set)); + g_ptr_array_set_free_func (satisfied_requests, g_free); + request_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref); @@ -2040,7 +2031,7 @@ collect_satisfied_requests (const GList *channels, if (paths_out != NULL) *paths_out = satisfied_requests; else - free_satisfied_requests (satisfied_requests); + g_ptr_array_unref (satisfied_requests); if (props_out != NULL) *props_out = request_properties; @@ -2123,7 +2114,7 @@ _mcd_dispatch_operation_run_observers (McdDispatchOperation *self) observe_channels_cb, g_object_ref (self), g_object_unref, NULL); - free_satisfied_requests (satisfied_requests); + g_ptr_array_unref (satisfied_requests); _mcd_tp_channel_details_free (channels_array); |