summaryrefslogtreecommitdiff
path: root/atk-adaptor/accessible-cache.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2011-08-15 14:22:02 -0500
committerMike Gorse <mgorse@novell.com>2011-08-15 14:22:02 -0500
commita1a316d1ef4167dbca147bc3477ed22305c83743 (patch)
tree1cc5075eba5489aeb0b04d15515c2c13d8697c1d /atk-adaptor/accessible-cache.c
parent8c08a7600a39a10e5d1e6dc0c22a5ae196bce823 (diff)
downloadat-spi2-core-a1a316d1ef4167dbca147bc3477ed22305c83743.tar.gz
Fixed some problems when shutting down and restarting the module
If gnome_accessibility_module_shutdown was called and followed by a call to gnome_accessibility_module_init, then things would go awry because of various resources not being freed. Fixed several of these issues, although some issues might remain.
Diffstat (limited to 'atk-adaptor/accessible-cache.c')
-rw-r--r--atk-adaptor/accessible-cache.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c
index ad39819e..4d5cdb35 100644
--- a/atk-adaptor/accessible-cache.c
+++ b/atk-adaptor/accessible-cache.c
@@ -125,8 +125,8 @@ spi_cache_init (SpiCache * cache)
add_subtree (cache, spi_global_app_data->root);
- atk_add_global_event_listener (child_added_listener,
- "Gtk:AtkObject:children-changed");
+ cache->child_added_listener = atk_add_global_event_listener (child_added_listener,
+ "Gtk:AtkObject:children-changed");
g_signal_connect (G_OBJECT (spi_global_app_data->root),
"children-changed::add",
@@ -141,7 +141,15 @@ spi_cache_finalize (GObject * object)
while (!g_queue_is_empty (cache->add_traversal))
g_object_unref (G_OBJECT (g_queue_pop_head (cache->add_traversal)));
g_queue_free (cache->add_traversal);
- g_free (cache->objects);
+ g_hash_table_unref (cache->objects);
+
+ g_signal_handlers_disconnect_by_func (spi_global_register,
+ (GCallback) remove_object, cache);
+
+ g_signal_handlers_disconnect_by_func (G_OBJECT (spi_global_app_data->root),
+ (GCallback) toplevel_added_listener, NULL);
+
+ atk_remove_global_event_listener (cache->child_added_listener);
G_OBJECT_CLASS (spi_cache_parent_class)->finalize (object);
}