win: make sure to skip fading before freeing struct win

Fix leaks of animatable user data.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-03-26 18:51:57 +00:00
parent f01c024a84
commit ec4df3c512
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
2 changed files with 7 additions and 0 deletions

View File

@ -309,6 +309,9 @@ static inline void ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t *
if (!w->managed || !win_as_managed(w)->to_paint) {
// If the window wasn't managed, or was already not rendered,
// we don't need to fade it out.
if (w->managed) {
win_skip_fading(win_as_managed(w));
}
destroy_win_finish(ps, w);
}
return;
@ -439,6 +442,9 @@ static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t
}
}
destroy_win_start(ps, old_w);
if (old_w->managed) {
win_skip_fading(win_as_managed(old_w));
}
destroy_win_finish(ps, old_w);
}

View File

@ -903,6 +903,7 @@ static void unmap_win_finish(session_t *ps, struct managed_win *w) {
// Try again at binding images when the window is mapped next time
win_clear_flags(w, WIN_FLAGS_IMAGE_ERROR);
assert(w->number_of_animations == 0);
}
struct window_transition_data {