ignoring memory leaks using HideLeak
Posted: Sun Jan 31, 2021 1:10 am
There seems to be a known memory leak when it comes to Windows and critical sections.
Namely, the same InitializeCriticalSection leak from FireDAC's sqlite gets reported exactly 12 times, even if i repeat the same operation more often than that; as if the resources are kept for later use.
I would like to remove those leaks from leaks report, but have no idea how to.
In this older thread, the following syntax seemed to have been implemented, yet using it gives a compilation error.
viewtopic.php?f=4&t=27655
assuming it did exist, I would also have to 'uses' whatever Delphi unit defining the type "InitializeCriticalSection", which i guess is no problem.
i did succeed hiding that leak, by wrapping the troublesome "FireDAC connection.connect" line with "StopLeakChecking" and "StartLeakChecking", though i don't know how satisfactory this approach is.
Attempting to use the available HideLeak function elsewhere to get familiar with it,
the reported message changed but did not go away.
Any ideas?
Thanks!
Namely, the same InitializeCriticalSection leak from FireDAC's sqlite gets reported exactly 12 times, even if i repeat the same operation more often than that; as if the resources are kept for later use.
I would like to remove those leaks from leaks report, but have no idea how to.
In this older thread, the following syntax seemed to have been implemented, yet using it gives a compilation error.
viewtopic.php?f=4&t=27655
Code: Select all
function HideLeak (someClass: TClass; count: integer) : boolean; overload;
i did succeed hiding that leak, by wrapping the troublesome "FireDAC connection.connect" line with "StopLeakChecking" and "StartLeakChecking", though i don't know how satisfactory this approach is.
Attempting to use the available HideLeak function elsewhere to get familiar with it,
Code: Select all
vThread := TpMyThread.Create (@vCount);
MadExcept.HideLeak (vThread);
Any ideas?
Thanks!