Dear all,
the second example of the fpjson examples in the official doc causes a memleak on
https://www.freepascal.org/docs-html/fcl/fpjson/index.htmlIf you compile with -gh you can see what I mean.
D:=GetJSON('{ "Children" : ['+
' { "Age" : 23, '+
' "Names" : { "LastName" : "Rodriquez",'+
' "FirstName" : "Roberto" }},'+
' { "Age" : 20,'+
' "Names" : { "LastName" : "Rodriquez",'+
' "FirstName" : "Maria" }}'+
' ]}');
E:=D.FindPath('Children[1].Names.FirstName');
Writeln(E.AsJSON);
FreeAndNil( D ); //<--- This line is missing!
In general I think the documentation should say something about the management of descendants of TJSONData (Or did I miss something?). As far as I know it it is in the responsibility of the user to free the root element but child elements get freed automatically.
Is there some way you can suggest changes to the documentation?