Skip to content

Commit

Permalink
[dbus] fix a wrong dbus destruct order that my cause deadlock on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Feb 24, 2017
1 parent dd30b92 commit addf6fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module/dbus/dbusstuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ void* DBusCreate(FcitxInstance* instance)

void DBusDestroy(void* arg) {
FcitxDBus* dbusmodule = (FcitxDBus*)arg;

fcitx_handler_table_free(dbusmodule->handler);

if (dbusmodule->conn) {
dbus_bus_release_name(dbusmodule->conn, dbusmodule->serviceName, NULL);
dbus_connection_unref(dbusmodule->conn);
Expand All @@ -408,8 +411,6 @@ void DBusDestroy(void* arg) {
DBusKill(&dbusmodule->daemon);
free(dbusmodule->serviceName);

fcitx_handler_table_free(dbusmodule->handler);

dbus_shutdown();

free(dbusmodule);
Expand Down

0 comments on commit addf6fd

Please sign in to comment.