From 25f694dd10a0bcf8904eed6f11e7bfc1a3e68255 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 14 Sep 2012 14:20:51 -0400 Subject: [PATCH] Make cleanup more robust https://bugzilla.gnome.org/show_bug.cgi?id=684042 --- atk-adaptor/bridge.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c index be1810c..f21072f 100644 --- a/atk-adaptor/bridge.c +++ b/atk-adaptor/bridge.c @@ -940,6 +940,7 @@ atk_bridge_adaptor_cleanup (void) dbus_connection_remove_filter (spi_global_app_data->bus, signal_filter, NULL); droute_context_unregister (spi_global_app_data->droute, spi_global_app_data->bus); dbus_connection_unref (spi_global_app_data->bus); + spi_global_app_data->bus = NULL; } for (l = spi_global_app_data->direct_connections; l; l = l->next) @@ -953,15 +954,16 @@ atk_bridge_adaptor_cleanup (void) dbus_connection_unref (connection); } g_list_free (spi_global_app_data->direct_connections); + spi_global_app_data->direct_connections = NULL; for (ls = clients; ls; ls = ls->next) g_free (l->data); g_slist_free (clients); clients = NULL; - g_object_unref (spi_global_cache); - g_object_unref (spi_global_leasing); - g_object_unref (spi_global_register); + g_clear_object (&spi_global_cache); + g_clear_object (&spi_global_leasing); + g_clear_object (&spi_global_register); if (spi_global_app_data->main_context) g_main_context_unref (spi_global_app_data->main_context); -- 2.7.4