wayland: Unlink surface listener when freeing token

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2592#note_1537253
This commit is contained in:
Kalev Lember 2022-08-25 11:47:38 +02:00
parent 429b3538b2
commit db887dd10b
2 changed files with 39 additions and 1 deletions

31
2594.patch Normal file
View File

@ -0,0 +1,31 @@
From 9d558e334cb74a09932e7ea8013c7e1babb1b215 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Thu, 25 Aug 2022 11:07:53 +0200
Subject: [PATCH] wayland: Unlink surface listener when freeing token
If the token ended up consumed and freed, we might leave a dangling
destroy listener after freeing the token struct.
Fixes: ed516dde89 (wayland: Add destruction listener to activation token surface)
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2594>
---
src/wayland/meta-wayland-activation.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/wayland/meta-wayland-activation.c b/src/wayland/meta-wayland-activation.c
index b7035ab5ce..db1f2b10d8 100644
--- a/src/wayland/meta-wayland-activation.c
+++ b/src/wayland/meta-wayland-activation.c
@@ -214,6 +214,9 @@ meta_xdg_activation_token_free (MetaXdgActivationToken *token)
g_clear_object (&token->sequence);
}
+ if (token->surface)
+ wl_list_remove (&token->surface_listener.link);
+
g_free (token->app_id);
g_free (token->token);
g_free (token);
--
GitLab

View File

@ -10,7 +10,7 @@
Name: mutter
Version: 43~beta
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Window and compositing manager based on Clutter
License: GPLv2+
@ -36,6 +36,10 @@ Patch4: 2592.patch
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2588
Patch5: 2588.patch
# Backported from upstream
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2594
Patch6: 2594.patch
BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(libwacom)
@ -179,6 +183,9 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{_datadir}/mutter-%{mutter_api_version}/tests
%changelog
* Thu Aug 25 2022 Kalev Lember <klember@redhat.com> - 43~beta-4
- wayland: Unlink surface listener when freeing token
* Thu Aug 25 2022 Kalev Lember <klember@redhat.com> - 43~beta-3
- wayland: Ensure to unlink destroy listeners after destruction