Page 1 of 1

Leak report - InitializeCriticalSection

Posted: Thu Jul 30, 2020 11:31 am
by lxo
Hello,
every time I get the leak report with MadExcept in Delphi, with two entries "InitializeCriticalSection".

The trigger seems to be the initialization part of IdStack.pas and IdThread.pas.

If I deactivate MadExcept and only activate ReportMemoryLeaksOnShutdown in Delphi I get no message about the leaks.

Re: Leak report - InitializeCriticalSection

Posted: Thu Jul 30, 2020 11:47 am
by madshi
These are true leaks. But they're resource leaks, not memory leaks. ReportMemoryLeaksOnShutdown only checks for memory leaks.

With the latest madExcept update:

http://madshi.net/madCollectionUpdate.exe

... you can call "madExcept.HideInitializationLeaks()" to hide any leaks that occur within any unit "initialization" sections, if you so prefer.