Root: fix leak on view destroy

This leaks memory and possibly an fd currently whenever a view is
destroyed.
This commit is contained in:
Isaac Freund 2024-04-08 15:02:55 +02:00
parent b0e54c6396
commit a374c6ab84
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -725,6 +725,7 @@ fn commitTransaction(root: *Root) void {
// This must be done after updating cursor state in case the view was the target of move/resize.
var it = root.hidden.inflight.focus_stack.safeIterator(.forward);
while (it.next()) |view| {
view.dropSavedSurfaceTree();
if (view.destroying) view.destroy();
}
}