summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2010-08-16 18:21:06 -0400
committerMike Gorse <mgorse@novell.com>2010-08-16 18:21:06 -0400
commite9d07f63b34219ce5fab8a3b979b1c98653faf57 (patch)
treef371b1c78a10da4ef2e94b772a18129ed99e6888
parent573ab181a2b473ffa087eb31e057b2453cb8315c (diff)
downloadat-spi2-atk-e9d07f63b34219ce5fab8a3b979b1c98653faf57.tar.gz
Ensure that an object is registered before adding it to the cache
We need to ensure that an object is registered before putting it in the cache, since registering the object adds the weak_ref that we use to know when the object should be removed from the cache. Prevents a crash in GetItems.
-rw-r--r--atk-adaptor/accessible-cache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c
index 5352217..f282d55 100644
--- a/atk-adaptor/accessible-cache.c
+++ b/atk-adaptor/accessible-cache.c
@@ -287,6 +287,11 @@ add_pending_items (gpointer data)
while (!g_queue_is_empty (to_add))
{
current = g_queue_pop_head (to_add);
+
+ /* Make sure object is registerd so we are notified if it goes away */
+ g_free (spi_register_object_to_path (spi_global_register,
+ G_OBJECT (current)));
+
add_object (cache, G_OBJECT(current));
g_object_unref (G_OBJECT (current));
}