Root: fix crash on deinit()

This commit is contained in:
Isaac Freund 2024-02-20 22:57:59 +01:00
parent a04c18819b
commit 53c09be846
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
2 changed files with 6 additions and 1 deletions

View File

@ -192,7 +192,6 @@ pub fn init(self: *Self) !void {
}
pub fn deinit(self: *Self) void {
self.scene.tree.node.destroy();
self.output_layout.destroy();
self.transaction_timeout.remove();
}

View File

@ -190,6 +190,12 @@ pub fn deinit(self: *Self) void {
self.wl_server.destroyClients();
self.backend.destroy();
// The scene graph needs to be destroyed after the backend but before the renderer
// Output destruction requires the scene graph to still be around while the scene
// graph may require the renderer to still be around to destroy textures it seems.
self.root.scene.tree.node.destroy();
self.renderer.destroy();
self.allocator.destroy();