Fix a memory leak during window.close
We weren't actually destroying the window or removing its link if the window was closed while it didn't have an output.
This commit is contained in:
parent
dc1e38e737
commit
3a7975eb1f
1 changed files with 14 additions and 13 deletions
|
|
@ -150,8 +150,8 @@ fn windowListener(river_window_v1: *river.WindowV1, event: river.WindowV1.Event,
|
||||||
seat.pending_manage.pointer_resize_request = null;
|
seat.pending_manage.pointer_resize_request = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If there's no output, we don't really care about focus and can skip this event
|
if (window.output) |output| {
|
||||||
const output = if (window.output) |output| output else return;
|
// Get a new window for the wm to focus
|
||||||
var it = window.context.wm.seats.iterator(.forward);
|
var it = window.context.wm.seats.iterator(.forward);
|
||||||
while (it.next()) |seat| {
|
while (it.next()) |seat| {
|
||||||
if (seat.focused_window == window) {
|
if (seat.focused_window == window) {
|
||||||
|
|
@ -169,6 +169,7 @@ fn windowListener(river_window_v1: *river.WindowV1, event: river.WindowV1.Event,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
window.link.remove();
|
window.link.remove();
|
||||||
window.destroy();
|
window.destroy();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue