commit 801f9b70cf31ba704c5262273b0dfac308b043f4 parent 15c43863c7882fe0e5976136be3ac2dbb0532c9c Author: Andrea Feletto <andrea@andreafeletto.com> Date: Tue, 28 Jun 2022 16:34:25 +0200 fix segfault when run without modules Diffstat:
M | src/Wayland.zig | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/Wayland.zig b/src/Wayland.zig @@ -60,8 +60,10 @@ pub fn deinit(self: *Wayland) void { self.monitors.deinit(); self.inputs.deinit(); - inline for (@typeInfo(Globals).Struct.fields) |field| { - @field(self.globals, field.name).destroy(); + inline for (@typeInfo(Globals).Struct.fields) |field, i| { + if (self.globalsMask[i]) { + @field(self.globals, field.name).destroy(); + } } self.display.disconnect(); }