summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-04-23 22:53:27 +0200
committerCarlos Garnacho <carlosg@gnome.org>2021-04-24 00:46:10 +0200
commitaec1bce40373530f6e582230a86a8fb4ae257fdf (patch)
treebf606b43321981bc56295eef44de3382593b1f29
parent7d3e2c5f9c09fae50450df691eeba0f067de8cff (diff)
downloadmutter-wip/carlosg/repeat-source-leak.tar.gz
backends/native: Unref/unset key repeat GSource when clearedwip/carlosg/repeat-source-leak
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.
-rw-r--r--src/backends/native/meta-seat-impl.c4
1 files changed, 3 insertions, 1 deletions
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