j2s
array
and object
generated code leak memory. #17
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Telodendria/Cytoplasm#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This line of
j2s.c
generates code that produces a memory leak. So does the analogous line for objects. It leaks aJsonValue
in an effort to duplicate the data. ThisJsonValue
should be stored in an intermediate variable and freed when it is no longer needed.This might actually be trickier than it seems because just calling
JsonValueFree()
will also free the associated data, which we want to keep. We literally want to free just theJsonValue
wrapper and keep the actual data inside of it.