summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2013-05-20 16:25:46 -0500
committerMike Gorse <mgorse@suse.com>2013-05-20 16:25:46 -0500
commitf7a825353ec966c1b447a81aec483406cb49853c (patch)
tree5a8354e115ff2f6803760e2401617505e5200713
parent031946b5b7ec90279ae60bbf974f23979979ea78 (diff)
downloadat-spi2-atk-f7a825353ec966c1b447a81aec483406cb49853c.tar.gz
Don't warn if an app returns NULL when referencing a child
If atk_object_ref_accessible_child returns NULL when creating the cache, then don't attempt to process/unref the NULL item, although applications probably shouldn't be returning NULL in response to a call to atk_object_ref_accessible_child, so it seems debatable whether we should be printing a warning here.
-rw-r--r--atk-adaptor/adaptors/cache-adaptor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/atk-adaptor/adaptors/cache-adaptor.c b/atk-adaptor/adaptors/cache-adaptor.c
index 79a9e6a..cad7396 100644
--- a/atk-adaptor/adaptors/cache-adaptor.c
+++ b/atk-adaptor/adaptors/cache-adaptor.c
@@ -154,8 +154,11 @@ append_cache_item (AtkObject * obj, gpointer data)
AtkObject *child;
child = atk_object_ref_accessible_child (obj, i);
- spi_object_append_reference (&iter_sub_array, child);
- g_object_unref (G_OBJECT (child));
+ if (child)
+ {
+ spi_object_append_reference (&iter_sub_array, child);
+ g_object_unref (G_OBJECT (child));
+ }
}
}
if (ATK_IS_SOCKET (obj) && atk_socket_is_occupied (ATK_SOCKET (obj)))