summaryrefslogtreecommitdiff
path: root/atk-adaptor/accessible-cache.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2012-02-06 16:35:43 -0600
committerMike Gorse <mgorse@novell.com>2012-02-06 16:35:43 -0600
commit9bf59744dc2547f79de03ed7f55ab3ea077bfa4d (patch)
treea0fef1836a24adf136e75619e50fa718855be590 /atk-adaptor/accessible-cache.c
parentb127ebb72cce5c710445b1c823379256921f1e45 (diff)
downloadat-spi2-core-9bf59744dc2547f79de03ed7f55ab3ea077bfa4d.tar.gz
Don't cache objects that return NULL when their state set is queried
If atk_object_ref_state_set returns NULL, then perhaps the object is going away or not yet initialized, so caching it may not be a good idea. Also stops some warnings.
Diffstat (limited to 'atk-adaptor/accessible-cache.c')
-rw-r--r--atk-adaptor/accessible-cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c
index 943a3206..20796d58 100644
--- a/atk-adaptor/accessible-cache.c
+++ b/atk-adaptor/accessible-cache.c
@@ -281,7 +281,7 @@ add_pending_items (gpointer data)
current = g_queue_pop_head (cache->add_traversal);
set = atk_object_ref_state_set (current);
- if (!atk_state_set_contains_state (set, ATK_STATE_TRANSIENT))
+ if (set && !atk_state_set_contains_state (set, ATK_STATE_TRANSIENT))
{
g_queue_push_tail (to_add, current);
if (!spi_cache_in (cache, G_OBJECT (current)) &&
@@ -292,7 +292,8 @@ add_pending_items (gpointer data)
}
}
- g_object_unref (set);
+ if (set)
+ g_object_unref (set);
}
while (!g_queue_is_empty (to_add))