diff options
author | Shinwoo Kim <cinoo.kim@samsung.com> | 2020-10-19 14:21:29 +0900 |
---|---|---|
committer | Shinwoo Kim <cinoo.kim@samsung.com> | 2020-10-19 14:21:29 +0900 |
commit | bfc7ca9d736bb9a50da1ca473e472486bd328b2f (patch) | |
tree | 71004ca16c31e12bbad37ad61f87e7796d7509ef | |
parent | 3faf8f76135e6b13b2ee871b8375a18a6b918a2d (diff) | |
download | at-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.c | 17 |
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; |