From aec1bce40373530f6e582230a86a8fb4ae257fdf Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 23 Apr 2021 22:53:27 +0200 Subject: backends/native: Unref/unset key repeat GSource when cleared This GSource is not being properly unref nor the variable holding it cleared. This on one hand leaks the GSource memory, on the other hand may trigger warnings in keyboard_repeat() as the source may be (reentrantly) cleared, yet we don't exit early as seat_impl->repeat_source is never NULL. --- src/backends/native/meta-seat-impl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c index 9137dc3c9..a7613627f 100644 --- a/src/backends/native/meta-seat-impl.c +++ b/src/backends/native/meta-seat-impl.c @@ -244,8 +244,10 @@ meta_seat_impl_clear_repeat_source (MetaSeatImpl *seat_impl) if (seat_impl->repeat_source) { g_source_destroy (seat_impl->repeat_source); - g_clear_object (&seat_impl->repeat_device); + g_clear_pointer (&seat_impl->repeat_source, g_source_unref); } + + g_clear_object (&seat_impl->repeat_device); } static void -- cgit v1.2.1