Allocate `doc.tokenizer`, and free it in `destroy`.
This commit is contained in:
Jeroen van Rijn
2025-06-09 15:09:04 +02:00
parent 87247b8bb7
commit 179e5b8835
+2 -1
View File
@@ -175,7 +175,7 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha
data = bytes.clone(data) data = bytes.clone(data)
} }
t := &Tokenizer{} t := new(Tokenizer)
init(t, string(data), path, error_handler) init(t, string(data), path, error_handler)
doc = new(Document) doc = new(Document)
@@ -403,6 +403,7 @@ destroy :: proc(doc: ^Document) {
} }
delete(doc.strings_to_free) delete(doc.strings_to_free)
free(doc.tokenizer)
free(doc) free(doc)
} }