#2 Memory Leak

open-fixed
nobody
None
5
2010-03-25
2009-11-12
Yi Zhang
No

function TJSONObject.toString(indentFactor, indent: integer): string;
This function has a line: _keys := keys(); The _keys not free until the function exit.

Please add a try .. finally _keys.Free end; for this function.

The line: key := x.nextValue().toString(); will cause a memory leak, too.
Please write in this way:

with x.nextValue() do
begin
key := toString();
Free; //Fix memory leak. By creation_zy
end;

Discussion

  • Jose Fabio N Almeida

    • status: open --> open-accepted
     
  • Jose Fabio N Almeida

    • status: open-accepted --> open-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks