[fpc-pascal] possible json parser memory leak

silvioprog silvioprog at gmail.com
Sun Dec 18 18:34:57 CET 2011


2011/12/18 ik <idokan at gmail.com>:
> Hello,
>
> I'm using FPC 2.6 (rc) x86_64 on Linux with JSONParser.
>
> I've written the following code:

Use:

var
  parser: TJSONParser;
  json_data: TJSONData;
  json_file: TFileStream;
begin
  json_file := TFileStream.Create('test.json', fmOpenRead);
  parser := TJSONParser.Create(json_file);
  json_data := parser.Parse;
  WriteLn(json_data.AsJSON);
  json_data.Free;
  json_file.Free;
  parser.Free;
end;

Thx.

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
Facebook - <facebook.com/silvioclecio>
LazSolutions - <code.google.com/p/lazsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================



More information about the fpc-pascal mailing list