#1 2017-10-31 23:44:51

bude
Member
Registered: 2017-10-31
Posts: 2

_jsonfast memory leak

Trying to sort out a memory leak, and I think I've narrowed it down to how I'm parsing Json. If I create a Delphi app that consists of nothing but this 1 statement:

_jsonfast('{"s": ""}');

It leaks (FASTMM4) 1 AnsiString object and 2 Unknown objects. If I change the statement to:

_jsonfast('{"s": "", "t": ""}');

Then the leak is 2 AnsiStrings and 2 Unknowns.

Is there some time of finalization one has to do when using _jsonfast?

Bud
(Delphi 2007 - latest  a44cc62 commit of mORMot)

Offline

#2 2017-11-01 18:10:05

bude
Member
Registered: 2017-10-31
Posts: 2

Re: _jsonfast memory leak

Some further information... my test was in a console app, so the _jsonfast call was in a .dpr file. When I restructured a bit and moved the _jsonfast statement to reside within a Delphi unit (.pas) that is simply called by the console app, the memory  leak went away.

Offline

#3 2017-11-01 20:13:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: _jsonfast memory leak

There is no leak. It is how the main .DPR block works.

Offline

Board footer

Powered by FluxBB