summaryrefslogtreecommitdiff
path: root/atk-adaptor/accessible-cache.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2012-09-13 12:55:36 -0500
committerMike Gorse <mgorse@suse.com>2012-09-13 12:55:36 -0500
commit611d01e09224ab1e2b1a22516feb6a13671be059 (patch)
tree3eb31a059f2b042c48bb89b766b2ad2766a4e87a /atk-adaptor/accessible-cache.c
parent278bafc52334d22f65e1d1d56af38ebc4b4f8352 (diff)
downloadat-spi2-core-611d01e09224ab1e2b1a22516feb6a13671be059.tar.gz
Only initialize the cache when an AT is running
If no AT is running, we shouldn't need to be maintaining the cache, so only initialize when an AT is active. Note that this change does not deinitialize the cache when an AT is no longer running. Deinitializing and setting spi_global_cache to NULL might be a good idea, but trying to keep risk to a minimum this close to 3.6.
Diffstat (limited to 'atk-adaptor/accessible-cache.c')
-rw-r--r--atk-adaptor/accessible-cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c
index a0922e6d..12bcfacb 100644
--- a/atk-adaptor/accessible-cache.c
+++ b/atk-adaptor/accessible-cache.c
@@ -109,6 +109,7 @@ static void spi_cache_class_init (SpiCacheClass * klass)
static void
spi_cache_init (SpiCache * cache)
{
+g_print("dbg: init cache\n");
cache->objects = g_hash_table_new (g_direct_hash, g_direct_equal);
cache->add_traversal = g_queue_new ();
@@ -422,6 +423,9 @@ spi_cache_foreach (SpiCache * cache, GHFunc func, gpointer data)
gboolean
spi_cache_in (SpiCache * cache, GObject * object)
{
+ if (!cache)
+ return FALSE;
+
if (g_hash_table_lookup_extended (cache->objects,
object,
NULL,