summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-10-19 14:21:29 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2020-10-19 14:21:29 +0900
commitbfc7ca9d736bb9a50da1ca473e472486bd328b2f (patch)
tree71004ca16c31e12bbad37ad61f87e7796d7509ef
parent3faf8f76135e6b13b2ee871b8375a18a6b918a2d (diff)
downloadat-spi2-core-bfc7ca9d736bb9a50da1ca473e472486bd328b2f.tar.gz
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.
-rw-r--r--atspi/atspi-misc.c17
1 files 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;