diff --git a/src/maomao.c b/src/maomao.c index 4374bc9..0bb1376 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -2397,8 +2397,6 @@ void cleanup(void) { xwayland = NULL; #endif - input_method_relay_finish(input_method_relay); - wl_display_destroy_clients(dpy); if (child_pid > 0) { kill(-child_pid, SIGTERM); @@ -2408,6 +2406,8 @@ void cleanup(void) { destroykeyboardgroup(&kb_group->destroy, NULL); + input_method_relay_finish(input_method_relay); + /* If it's not destroyed manually it will cause a use-after-free of wlr_seat. * Destroy it until it's fixed in the wlroots side */ wlr_backend_destroy(backend);