Fixed memory leak in ECS.

This commit is contained in:
Ernesto Lanchares 2025-04-04 18:57:21 +02:00
parent 25e51f9aea
commit ecff349a31

View file

@ -22,6 +22,7 @@ pub const Human = struct {
speed: components.Speed, speed: components.Speed,
}; };
// TODO(ernesto): Move pool to its own file
pub const Pool = struct { pub const Pool = struct {
humans: std.MultiArrayList(Human), humans: std.MultiArrayList(Human),
resources: Resources, resources: Resources,
@ -64,6 +65,7 @@ pub const Pool = struct {
self.humans.deinit(self.allocator); self.humans.deinit(self.allocator);
self.system_groups.deinit(); self.system_groups.deinit();
self.sync_groups.deinit();
self.thread_pool.deinit(); self.thread_pool.deinit();
self.allocator.destroy(self.thread_pool); self.allocator.destroy(self.thread_pool);
} }