[at-spi2-atk] Reset inited variable on cleanup



commit 1df4bed1ecb94b3fbc9bab19aff5c4cefb1c4c69
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jun 15 16:58:54 2012 +0100

    Reset inited variable on cleanup

 atk-adaptor/bridge.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
index d776a4b..666b34c 100644
--- a/atk-adaptor/bridge.c
+++ b/atk-adaptor/bridge.c
@@ -56,6 +56,8 @@ signal_filter (DBusConnection *bus, DBusMessage *message, void *user_data);
 
 SpiBridge *spi_global_app_data = NULL;
 
+static gboolean inited = FALSE;
+
 /*---------------------------------------------------------------------------*/
 
 static void
@@ -737,7 +739,6 @@ atk_bridge_adaptor_init (gint * argc, gchar ** argv[])
   GError *err = NULL;
   DBusError error;
   AtkObject *root;
-  static gboolean inited = FALSE;
   gboolean load_bridge;
 
   load_bridge = check_envvar ();
@@ -882,6 +883,8 @@ atk_bridge_adaptor_cleanup (void)
   GList *l;
   GSList *ls;
 
+  g_return_if_fail (inited);
+
   if (!spi_global_app_data)
       return;
 
@@ -925,6 +928,8 @@ atk_bridge_adaptor_cleanup (void)
 
   g_free (spi_global_app_data);
   spi_global_app_data = NULL;
+
+  inited = FALSE;
 }
 
 /*---------------------------------------------------------------------------*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]