Closed arvanus closed 2 years ago
It is much more complicated than I expected initially because it is called by different callers. Can you check my solution here?
https://github.com/SchneiderInfosystems/FB4D/commit/4b4e6c656d3d44ed80076b714cbcdfdeb41cb2db
With this change, the unit tests are passed, and no memory leaks occur.
Looks like it's working in this commit Thanks
Describe the bug Looks like at lines: https://github.com/SchneiderInfosystems/FB4D/blob/f9247a5e55e46fcb54ed18c517d40362b1091392/Source/FB4D.Document.pas#L238...L269 Specifically in my case https://github.com/SchneiderInfosystems/FB4D/blob/f9247a5e55e46fcb54ed18c517d40362b1091392/Source/FB4D.Document.pas#L261-L267 In the last line where you free JSONObj, you also are freeing fDocumentList[0], a solution would be to clone JSONObj at
CreateFromJSONObj
, not sure why this happens, because somethimes it work, sometimes dont, and at the demo it's working too At line you simply copy the JSON, that is latter freed: https://github.com/SchneiderInfosystems/FB4D/blob/f9247a5e55e46fcb54ed18c517d40362b1091392/Source/FB4D.Document.pas#L409 My (temporary) solution here was to simply clonefJSONObj := JSONObj.Clone as TJSONObject;
To Reproduce
Expected behavior Return the document, but nil found
Screenshots
Desktop (please complete the following information):