content-protection: Don't leak update timer on shutdown

If we still have a pending idle timer when the compositor is being
destroyed, make sure to free it first.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2021-12-06 16:59:26 +00:00
parent a272604c00
commit 61851f5c37
1 changed files with 2 additions and 0 deletions

View File

@ -189,6 +189,8 @@ cp_destroy_listener(struct wl_listener *listener, void *data)
wl_list_remove(&cp->protected_list);
weston_log_scope_destroy(cp->debug);
cp->debug = NULL;
if (cp->surface_protection_update)
wl_event_source_remove(cp->surface_protection_update);
cp->surface_protection_update = NULL;
cp->compositor->content_protection = NULL;
free(cp);