From 98c15e812a24112a8276fa4a62e208a5f008d135 Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Wed, 1 Jun 2011 18:01:42 +0100 Subject: Update NEWS --- NEWS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 577e2057..b3481d3c 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,12 @@ Fixes: not correctly handle all internal requests which should have been dispatched to an existing channel (fledermaus) +Enhancements: + +• Centralised debug control for MCP plugins via MCP_DEBUG environment + variable (and macro + flags so out-of-tree plugins can take advantage + of same) (fledermaus) + telepathy-mission-control 5.7.11 (2011-05-11) ============================================ -- cgit v1.2.1 From feed5e78989b49983bb9231e5340ec021fc09dc8 Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Thu, 2 Jun 2011 19:11:06 +0100 Subject: The 'set' GHashTable in collect_satisfied_requests was leaked --- src/mcd-dispatch-operation.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c index cb1e83a3..14e7560f 100644 --- a/src/mcd-dispatch-operation.c +++ b/src/mcd-dispatch-operation.c @@ -1978,6 +1978,17 @@ 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 @@ -2010,7 +2021,7 @@ collect_satisfied_requests (const GList *channels, satisfied_requests = g_ptr_array_sized_new (g_hash_table_size (set)); request_properties = g_hash_table_new_full (g_str_hash, g_str_equal, - NULL, (GDestroyNotify) g_hash_table_unref); + g_free, (GDestroyNotify) g_hash_table_unref); g_hash_table_iter_init (&it, set); @@ -2018,16 +2029,18 @@ collect_satisfied_requests (const GList *channels, { GHashTable *props; - g_ptr_array_add (satisfied_requests, path); + g_ptr_array_add (satisfied_requests, g_strdup (path)); props = _mcd_request_dup_immutable_properties (value); g_assert (props != NULL); - g_hash_table_insert (request_properties, path, props); + g_hash_table_insert (request_properties, g_strdup (path), props); } + g_hash_table_unref (set); + if (paths_out != NULL) *paths_out = satisfied_requests; else - g_ptr_array_unref (satisfied_requests); + free_satisfied_requests (satisfied_requests); if (props_out != NULL) *props_out = request_properties; @@ -2110,9 +2123,7 @@ _mcd_dispatch_operation_run_observers (McdDispatchOperation *self) observe_channels_cb, g_object_ref (self), g_object_unref, NULL); - /* don't free the individual object paths, which are borrowed from the - * McdChannel objects */ - g_ptr_array_unref (satisfied_requests); + free_satisfied_requests (satisfied_requests); _mcd_tp_channel_details_free (channels_array); -- cgit v1.2.1 From 07e875ab4a41add247b4127470be6e45a3530e82 Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Wed, 8 Jun 2011 18:40:25 +0100 Subject: Unref wrapper not required if we set the free func --- src/mcd-dispatch-operation.c | 17 ++++------------- 1 file 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); -- cgit v1.2.1