Browse Source

Merge pull request #2407 from igordreher/json.destroy_value

Add allocator parameter to `json.detroy_value`
Jeroen van Rijn 2 years ago
parent
commit
3e1daa002c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      core/encoding/json/types.odin

+ 3 - 3
core/encoding/json/types.odin

@@ -87,7 +87,8 @@ Error :: enum {
 
 
 
-destroy_value :: proc(value: Value) {
+destroy_value :: proc(value: Value, allocator := context.allocator) {
+	context.allocator := allocator
 	#partial switch v in value {
 	case Object:
 		for key, elem in v {
@@ -103,5 +104,4 @@ destroy_value :: proc(value: Value) {
 	case String:
 		delete(v)
 	}
-}
-
+}