fix: also check scene_buf NULL to detect stale WINGs frame_bufs (parent frame can also leak, making parent_id check insufficient)

This commit is contained in:
lkn 2026-06-06 12:03:35 +02:00
parent fc27be21e3
commit f606558698
1 changed files with 6 additions and 3 deletions

View File

@ -241,9 +241,12 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
struct wl_frame_buf *_fb, *_next;
wl_list_for_each_safe(_fb, _next, &wl_state.frame_list, link) {
if (_fb->id >= 0x20000000 && !wl_find_view_by_id(_fb->id)) {
/* Stale WINGs frame_buf from a previous session whose
* parent toplevel no longer exists — clean it up. */
if (_fb->parent_id && !frame_buf_find(_fb->parent_id)) {
/* Stale WINGs frame_buf from a previous session — clean it
* up if its scene buffer was auto-destroyed (parent tree was
* destroyed, cascade nulled the pointer) or if the parent
* frame no longer exists. */
if (!_fb->scene_buf ||
(_fb->parent_id && !frame_buf_find(_fb->parent_id))) {
W_UnregisterBacking(_fb->id);
wl_list_remove(&_fb->link);
wlr_buffer_drop(&_fb->base);