#1 2019-08-21 08:57:27

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

What might cause TDocVariant.NewFast memory leak?

Hello ab,

I'm having trouble fixing a memory leak caused by a variant variable. I'm wondering if you have any suggestions.
The procedure  which is something like:

var
  v: Variant;
begin
  TDocVariant.NewFast(v);
  v.SomeString := 'testString';
  AnotherProc(v);
end;

The following are one of memory leak report by madExcept:

type: GetMem
address: $15b33c28
size: 27
access rights: read/write

thread $7fc (TMyWorkerThread):
671c90b2 madExcept32.dll madExceptDbg              1603 GetMemCallback
00406c74 app1.exe System                    4189 @GetMem
006d7196 app1.exe SynCommons               20604 FastSetString
006d55f6 app1.exe SynCommons               18893 RawUnicodeToUtf8
006f4339 app1.exe SynCommons               43865 TSynInvokeableVariantType.SetProperty
00470ab2 app1.exe System.Variants           6340 TInvokeableVariantType.DispInvoke
00466b60 app1.exe System.Variants            930 DispInvokeCore
00466bc2 app1.exe System.Variants            953 @DispInvoke
012fbcda app1.exe MyUnit1                    309 TMyClasss.LoadRenderingContext
...
00d740e1 app1.exe EyThreadPool               436 TEyExecProcWorkItem.Execute
00d73db1 app1.exe EyThreadPool               378 TEyWorkerThread.Execute
004b002b app1.exe madExcept                17436 HookedTThreadExecute
00541366 app1.exe System.Classes           14548 ThreadProc
0040b9d8 app1.exe System                   22016 ThreadWrapper
004aff11 app1.exe madExcept                17369 CallThreadProcSafe
004aff76 app1.exe madExcept                17419 ThreadExceptFrame
75ab343b kernel32.dll                                   BaseThreadInitThunk

Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

Board footer

Powered by FluxBB