From: Mike Gorse Date: Fri, 27 Jun 2008 19:11:01 +0000 (-0400) Subject: Avoid reentering spi_dbus_update_cache X-Git-Tag: AT_SPI2_CORE_0_1_3~180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6a2f7399b24ad2a4aaea9df89d2a884e5a7ec2b;p=platform%2Fupstream%2Fat-spi2-core.git Avoid reentering spi_dbus_update_cache --- diff --git a/atk-adaptor/tree.c b/atk-adaptor/tree.c index eaf5cbe..01b53a4 100644 --- a/atk-adaptor/tree.c +++ b/atk-adaptor/tree.c @@ -293,12 +293,15 @@ static void handle_cache_item(char *path, guint action, CacheIterData *d) g_hash_table_remove(cache_list, path); } -gboolean spi_dbus_update_cache(DRouteData *data) +gboolean +spi_dbus_update_cache(DRouteData *data) { DBusMessage *message; DBusMessageIter iter; CacheIterData d; + static gboolean in_update_cache = FALSE; + if (in_update_cache) return TRUE; g_assert(data != NULL); if (update_pending == 0) return FALSE; @@ -310,6 +313,7 @@ gboolean spi_dbus_update_cache(DRouteData *data) &d.iter); d.droute = data; d.removing = FALSE; + in_update_cache = TRUE; do { /* This loop is needed because appending an item may cause new children @@ -322,6 +326,7 @@ gboolean spi_dbus_update_cache(DRouteData *data) dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "o", &d.iter); d.removing = TRUE; g_hash_table_foreach(cache_list, (GHFunc)handle_cache_item, &d); + in_update_cache = FALSE; dbus_message_iter_close_container(&iter, &d.iter); dbus_connection_send(data->bus, message, NULL); done: