zero tracking_allocator.allocation_map and tracking_allocator.bad_free_array in destroy. Allows for re-using the struct again after an init. Otherwise, there would be dangling references. e.g. to tracking_allocator.allocation_map.data

This commit is contained in:
Phil
2026-08-02 14:26:19 -07:00
parent 280f02f4ef
commit 3e24e2601c

View File

@@ -82,6 +82,8 @@ Destroy the tracking allocator.
tracking_allocator_destroy :: proc(t: ^Tracking_Allocator) {
delete(t.allocation_map)
delete(t.bad_free_array)
t.allocation_map = {}
t.bad_free_array = {}
}
/*