[at-spi2-core: 1/2] misc: unref bus at the end of cleanup




commit bfc7ca9d736bb9a50da1ca473e472486bd328b2f
Author: Shinwoo Kim <cinoo kim samsung com>
Date:   Mon Oct 19 14:21:29 2020 +0900

    misc: unref bus at the end of cleanup
    
    The g_object_run_dispose needs bus as below.
    
      g_object_run_dispose > atspi_application_dispose > _atspi_bus
    
    So close, unref and set bus to NULL after using bus is done.

 atspi/atspi-misc.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 02677b56..f6882d25 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -146,15 +146,8 @@ cleanup ()
       g_hash_table_destroy (refs);
     }
 
-  if (bus)
-    {
-      dbus_connection_close (bus);
-      dbus_connection_unref (bus);
-      bus = NULL;
-    }
-
   if (!desktop)
-    return;
+    goto end;
 
   /* TODO: Do we need this code, or should we just dispose the desktop? */
   for (i = desktop->children->len - 1; i >= 0; i--)
@@ -168,6 +161,14 @@ cleanup ()
   g_object_run_dispose (G_OBJECT (desktop->parent.app));
   g_object_unref (desktop);
   desktop = NULL;
+
+end:
+  if (bus)
+    {
+      dbus_connection_close (bus);
+      dbus_connection_unref (bus);
+      bus = NULL;
+    }
 }
 
 static gboolean atspi_inited = FALSE;


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