Fix an errant g_object_unref
authorMike Gorse <mgorse@suse.com>
Tue, 18 Sep 2012 00:06:40 +0000 (19:06 -0500)
committerMike Gorse <mgorse@suse.com>
Tue, 18 Sep 2012 00:06:40 +0000 (19:06 -0500)
If an object is deregistered but not in the cache, then only unref it if
it was found in the queue of objects to be added (ie, it is possible
that it is leased, rather than queued to be cached, in which case it
should not be unrefed).

atk-adaptor/accessible-cache.c

index 3a30b514114030bd50a60adf6a986554207c67c4..be247e4465fab472c0ede44ae32c0eeedae83033 100644 (file)
@@ -179,9 +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
+  else if (g_queue_remove (cache->add_traversal, gobj))
     {
-      g_queue_remove (cache->add_traversal, gobj);
       g_object_unref (gobj);
     }
 }