Add navigation helper functions for screen-reader and friends
[platform/upstream/at-spi2-core.git] / atspi / atspi-application.c
index c2202a1..65cabdc 100644 (file)
@@ -43,6 +43,8 @@ atspi_application_dispose (GObject *object)
 
   if (application->bus)
   {
+    if (application->bus != _atspi_bus ())
+      dbus_connection_close (application->bus);
     dbus_connection_unref (application->bus);
     application->bus = NULL;
   }
@@ -54,6 +56,12 @@ atspi_application_dispose (GObject *object)
     application->hash = NULL;
   }
 
+  if (application->root)
+  {
+    g_object_unref (application->root);
+    application->root = NULL;
+  }
+
   G_OBJECT_CLASS (atspi_application_parent_class)->dispose (object);
 }
 
@@ -62,8 +70,10 @@ atspi_application_finalize (GObject *object)
 {
   AtspiApplication *application = ATSPI_APPLICATION (object);
 
-  if (application->bus_name)
-    g_free (application->bus_name);
+  g_free (application->bus_name);
+  g_free (application->toolkit_name);
+  g_free (application->toolkit_version);
+  g_free (application->atspi_version);
 
   G_OBJECT_CLASS (atspi_application_parent_class)->finalize (object);
 }
@@ -83,7 +93,7 @@ _atspi_application_new (const gchar *bus_name)
   AtspiApplication *application;
   
   application = g_object_new (ATSPI_TYPE_APPLICATION, NULL);
-  if (application)
-    application->bus_name = g_strdup (bus_name);
+  application->bus_name = g_strdup (bus_name);
+  application->root = NULL;
   return application;
 }