I am observing a memory leak inside
uJSONToRODL.TJSONToRODL.LoadStreamToLibrary as being called indirectly by
The code has this line:
l_root := JSON_ParseStream(Source, True).AsObject;
JSON_ParseStream creates an instance and by contract expects the caller to take ownership of the instance it has created.
LoadStreamToLibrary method never frees it and thus an entire JSON structure is leaked.
Note that freeing
l_root is not enough because it’s the return of
AsObject that would be freed and not the result of
Here is a patch file with the change that I have done:
uJSONToRODL.pas.zip (628 Bytes)
With this, I no longer get a memory leak while not getting any errors at runtime.
Hope this helps.