X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=blobdiff_plain;f=atk-adaptor%2Faccessible-cache.c;h=afaedb0f00635eb8700d1334743f62a1e27e7b1a;hp=943a3206fafc293e13432954b61f90e7f97f3379;hb=3bdee8357cd975dfb03ea98a3bdbfcfc3c1da7e0;hpb=85af8a25e4fa1c4a65cdbe145b70c334aac97e48 diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c index 943a320..afaedb0 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)) @@ -320,9 +321,7 @@ child_added_listener (GSignalInvocationHint * signal_hint, const GValue * param_values, gpointer data) { SpiCache *cache = spi_global_cache; - gboolean child_needs_ref = TRUE; AtkObject *accessible; - AtkObject *child; const gchar *detail = NULL; @@ -351,14 +350,13 @@ child_added_listener (GSignalInvocationHint * signal_hint, gpointer child; int index = g_value_get_uint (param_values + 1); child = g_value_get_pointer (param_values + 2); - - if (!ATK_IS_OBJECT (child)) + if (!child) { - child = atk_object_ref_accessible_child (accessible, index); - child_needs_ref = FALSE; + g_static_rec_mutex_unlock (&cache_mutex); + return; } - if (child_needs_ref) - g_object_ref (child); + + g_object_ref (child); g_queue_push_tail (cache->add_traversal, child); if (cache->add_pending_idle == 0) @@ -424,6 +422,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,