From: Mike Gorse Date: Mon, 20 May 2013 21:25:46 +0000 (-0500) Subject: Don't warn if an app returns NULL when referencing a child X-Git-Tag: AT_SPI2_ATK_2_12_0~32 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=commitdiff_plain;h=f7a825353ec966c1b447a81aec483406cb49853c 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. --- 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)))