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>
This commit is contained in:
Carlos Garnacho 2022-08-25 11:07:53 +02:00
parent 8ad4056aa2
commit 9d558e334c

View File

@ -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);