output: destroy Layouts on Output removal

The Layout struct holds a pointer to the Output which becomes invalid
when the Output is destroyed so we must ensure all the layouts of an
Output are destroyed first.
This commit is contained in:
Isaac Freund
2021-06-09 20:03:19 +00:00
parent 2e7c1dbe6a
commit 88410cc2b8
3 changed files with 13 additions and 2 deletions

View File

@ -206,6 +206,9 @@ pub fn removeOutput(self: *Self, output: *Output) void {
}
}
// Destroy all layouts of the output
while (output.layouts.first) |layout_node| layout_node.data.destroy();
// Arrange the root in case evacuated views affect the layout
fallback_output.arrangeViews();
self.startTransaction();