Closed jacobwilliams closed 2 years ago
Thanks!
And just so I'm sure I understand: The reason we don't need to destroy other json_value
pointers, in this case, is because they are all pointing to child nodes of model_config_json
, so by destroying it, we free the whole structure including the child nodes, yes?
Yep, that is correct. The destroy
call deallocates the entire tree structure.
The other variables are pointers to the existing structure. When you destroy the structure they are now dangling pointers, but since they are just local variables it doesn't matter.
Fixes #82