From dc527ed5104ce5eb5e82e1d108b577a67c274461 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 5 Aug 2023 11:11:58 +0200 Subject: [PATCH] backends/native: Close the input thread in all situations on dispose In test situations we sometimes do not create a libinput context, so our check on dispose to see if we need closing the input thread is off if META_SEAT_NATIVE_FLAG_NO_LIBINPUT was provided. Check the input thread existing instead, since that is the thing we want to undo here. Part-of: --- src/backends/native/meta-seat-impl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c index 99b01259d..0c26647b4 100644 --- a/src/backends/native/meta-seat-impl.c +++ b/src/backends/native/meta-seat-impl.c @@ -3055,7 +3055,7 @@ destroy_in_impl (GTask *task) void meta_seat_impl_destroy (MetaSeatImpl *seat_impl) { - if (seat_impl->libinput) + if (seat_impl->input_thread) { GTask *task; @@ -3065,6 +3065,7 @@ meta_seat_impl_destroy (MetaSeatImpl *seat_impl) g_object_unref (task); g_thread_join (seat_impl->input_thread); + seat_impl->input_thread = NULL; g_assert (!seat_impl->libinput); }