Remove erroneous debug print introduced in last commit
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / accessible-cache.c
index 4d5cdb3..afaedb0 100644 (file)
@@ -179,6 +179,8 @@ remove_object (GObject * source, GObject * gobj, gpointer data)
       g_signal_emit (cache, cache_signals [OBJECT_REMOVED], 0, gobj);
       g_hash_table_remove (cache->objects, gobj);
     }
+  else
+    g_queue_remove (cache->add_traversal, gobj);
 }
 
 static void
@@ -279,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)) &&
@@ -290,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))
@@ -318,9 +321,7 @@ child_added_listener (GSignalInvocationHint * signal_hint,
                       const GValue * param_values, gpointer data)
 {
   SpiCache *cache = spi_global_cache;
-
   AtkObject *accessible;
-  AtkObject *child;
 
   const gchar *detail = NULL;
 
@@ -349,11 +350,12 @@ 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 (!child)
+            {
+              g_static_rec_mutex_unlock (&cache_mutex);
+              return;
+            }
 
-          if (!ATK_IS_OBJECT (child))
-           {
-             child = atk_object_ref_accessible_child (accessible, index);
-           }
           g_object_ref (child);
           g_queue_push_tail (cache->add_traversal, child);
 
@@ -420,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,