Browse Source

Fix memory leak in `core:flags` validation

Feoramund 1 year ago
parent
commit
42a5a2cf17
1 changed files with 1 additions and 0 deletions
  1. 1 0
      core/flags/internal_validation.odin

+ 1 - 0
core/flags/internal_validation.odin

@@ -14,6 +14,7 @@ import "core:strings"
 @(optimization_mode="size", disabled=ODIN_DISABLE_ASSERT)
 @(optimization_mode="size", disabled=ODIN_DISABLE_ASSERT)
 validate_structure :: proc(model_type: $T, style: Parsing_Style, loc := #caller_location) {
 validate_structure :: proc(model_type: $T, style: Parsing_Style, loc := #caller_location) {
 	positionals_assigned_so_far: bit_array.Bit_Array
 	positionals_assigned_so_far: bit_array.Bit_Array
+	defer bit_array.destroy(&positionals_assigned_so_far)
 
 
 	check_fields: for field in reflect.struct_fields_zipped(T) {
 	check_fields: for field in reflect.struct_fields_zipped(T) {
 		if style == .Unix {
 		if style == .Unix {