summaryrefslogtreecommitdiff
path: root/src/backends/meta-screen-cast-stream-src.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-07-10 09:06:33 +0200
committerJonas Ådahl <jadahl@gmail.com>2020-07-10 09:08:59 +0200
commitd67ba3ea65717ceab3e0c91267191c6ed2aac2c2 (patch)
treec01c99bbf0346e9714adb72ff667b870682894ff /src/backends/meta-screen-cast-stream-src.c
parent50634d450ecd826e5b51afa520bbcabf7f54c692 (diff)
downloadmutter-d67ba3ea65717ceab3e0c91267191c6ed2aac2c2.tar.gz
screen-cast/src: Remove follow up timeout source on disable
We failed to remove the timeout source when disabling, meaning that if a follow up was scheduled, and shortly after we disabled the source, the timeout would be invoked after the source was freed causing use-after-free bugs. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1337 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1365
Diffstat (limited to 'src/backends/meta-screen-cast-stream-src.c')
-rw-r--r--src/backends/meta-screen-cast-stream-src.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c
index 74df526db..a0ba05ea5 100644
--- a/src/backends/meta-screen-cast-stream-src.c
+++ b/src/backends/meta-screen-cast-stream-src.c
@@ -618,6 +618,8 @@ meta_screen_cast_stream_src_disable (MetaScreenCastStreamSrc *src)
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src)->disable (src);
+ g_clear_handle_id (&priv->follow_up_frame_source_id, g_source_remove);
+
priv->is_enabled = FALSE;
}