You are not logged in.
Pages: 1
Hi,
Look's like this is causing memory leak (6 x ansistring and 2 x unknown)
var
src,a: Variant;
begin
TDocVariant.New( src );
src.text := 'something';
src.attachments := _Obj(['field1','abc','field2','def','field3','foofoo']);
end;
And this is not
var
src,a: Variant;
begin
TDocVariant.New( src );
src.text := 'something';
a := _Obj(['field1','abc','field2','def','field3','foofoo']);
src.attachments := a;
end;
Is this supposed to be like this?
(Sorry I haven't yet figured out of all fine details of TdocVariant, even we use it quite much)
mika
Offline
There is something wrong on your sidE.
Not able to reproduce with the following code:
program ProjectDocVarLeak;
{$APPTYPE CONSOLE}
uses
FastMM4, // with EnableMemoryLeakReporting;FullDebugMode
SynCommons,
SysUtils;
procedure test;
var
src: Variant;
begin
TDocVariant.New( src );
src.text := 'something';
src.attachments := _Obj(['field1','abc','field2','def','field3','foofoo']);
end;
begin
test;
end.
Offline
Yes!
I opened my D2007 virtual and had no problems. This memory leak occurs with D10.1 Berlin and D10.2 Tokyo update 2.
In D10.1 I tried with and without fastmm4.
Offline
The same happens to me, I use ReportMemoryLeaksOnShutdown := True;
This causes MemoryLeak
v := _Obj(['token','123']);
v.document := _Obj(['ref', 'abc']);
--This works ok--
v := _Obj(['token','123', 'document',_Obj(['ref','abc']) ]);
--This works ok--
v := TDocVariant.New();
v.token := '123';
v.document := TDocVariant.New();
v.document.ref := 'abc';
Testing latest mormot sources, Windows10 , Delphi XE7
Offline
Pages: 1