git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit0f424b955a132bfe6c2135c28fdb5f9c23f6fd28
parent6fc1fcf7a0
authorIsaac Freund <[email protected]>
date2021-06-14 22:45
layout: fix use-after-free in destroy()

 river/Layout.zig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/river/Layout.zig b/river/Layout.zig
index 3682ec1..eca3d7b 100644
--- a/river/Layout.zig
+++ b/river/Layout.zig
@@ -191,8 +191,8 @@ pub fn destroy(self: *Self) void {
         server.root.startTransaction();
     }
 
+    self.layout.setHandler(?*c_void, handleRequestInert, null, null);
+
     util.gpa.free(self.namespace);
     util.gpa.destroy(node);
-
-    self.layout.setHandler(?*c_void, handleRequestInert, null, null);
 }