I have the following sample application that shows the problem:
program FalseMemLeak; uses ShareMem; var o: TObject; begin o := TObject.Create; // "good" leak RegisterExpectedMemoryLeak(o); TInterfacedObject.Create; // bad leak end.
Now I use the replacement BorlndMM.dll and FastMMFullDebug.dll, and I get the following report:
When I remove the “bad” memory leak, everything is fine and the report does not appear. But as soon as some unexpected memory leak occurs, it also lists the recorded leaks.
I initially discovered this when I looked for these Indy memory leaks and found that they were logged, but are still reported among those that are real memory leaks.
When I use the built-in ReportMemoryLeaksOnShutdown := True , it only reports a leak for TInterfacedObject .
So, is there a way to filter out a registered memory leak when using FastMM in full debug mode?
To make this clear: this is BorlndMM.dll, which comes with FastMM entries, and which says it is a replacement for one of them, and it uses FastMM4 and loads FastMM_FullDebugMode.dll. Thus, all calls to the memory manager are handled by FastMM4. But for some reason, this ignores filtering of registered leaks (which are registered in FastMM inside the replacement of BorlndMM.dll - this can be seen when debugging this DLL). Yes, reported leaks are not reported when using FastMM4.pas, but a change is not discussed.
source share