[at-spi2-atk] Don't leak ref when processing a child-added signal with no object value
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-atk] Don't leak ref when processing a child-added signal with no object value
- Date: Mon, 12 Dec 2011 17:23:58 +0000 (UTC)
commit 03c98c4848ecc1af3f3ffd68383660a8b8191a58
Author: Mike Gorse <mgorse novell com>
Date: Mon Dec 12 11:25:44 2011 -0600
Don't leak ref when processing a child-added signal with no object value
atk-adaptor/accessible-cache.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c
index 4d5cdb3..fa6b561 100644
--- a/atk-adaptor/accessible-cache.c
+++ b/atk-adaptor/accessible-cache.c
@@ -318,7 +318,7 @@ child_added_listener (GSignalInvocationHint * signal_hint,
const GValue * param_values, gpointer data)
{
SpiCache *cache = spi_global_cache;
-
+ gboolean child_needs_ref = TRUE;
AtkObject *accessible;
AtkObject *child;
@@ -351,10 +351,12 @@ child_added_listener (GSignalInvocationHint * signal_hint,
child = g_value_get_pointer (param_values + 2);
if (!ATK_IS_OBJECT (child))
- {
- child = atk_object_ref_accessible_child (accessible, index);
- }
- g_object_ref (child);
+ {
+ child = atk_object_ref_accessible_child (accessible, index);
+ child_needs_ref = FALSE;
+ }
+ if (child_needs_ref)
+ g_object_ref (child);
g_queue_push_tail (cache->add_traversal, child);
if (cache->add_pending_idle == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]