From 345bb0e419dd11dc6d1220157a94e82da30c2cea Mon Sep 17 00:00:00 2001 From: person-person <77169382+person-person@users.noreply.github.com> Date: Mon, 16 Oct 2023 04:57:39 -0400 Subject: [PATCH] Exit crash (#140) * Fixes crash on exit * Shorter comment --------- Co-authored-by: Person Person --- src/main.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.zig b/src/main.zig index bf6f8c12..13a5c406 100644 --- a/src/main.zig +++ b/src/main.zig @@ -758,6 +758,10 @@ pub fn main() !void { gui.windowlist.gpu_performance_measuring.stopQuery(); } } + + // Make sure that threadPool is done before freeing any data + threadPool.clear(); + if(game.world) |world| { world.deinit(); game.world = null;