wad*_*des 3 delphi fastmm delphi-xe2
我正在尝试使用FastMM版本4.99(根据顶部的评论FastMM4.pas
).我已经跟着 的 指示使用全调试模式堆栈跟踪,并发现我的泄漏,当我跑我的IDE调试器下的.exe.例如
但是当我尝试从命令提示符运行可执行文件,或者双击Windows资源管理器时,我没有报告泄漏.UnicodeString泄漏可能是假的,但我确信TIniFile泄漏是真实的.如何在不使用调试器时使FastMM报告/日志泄漏?
更新:此项目还使用madExcept 3.0n:.dpr文件确实将FastMM4作为其uses子句中的第一项.还有什么需要让这两者共存?
Ken*_*ite 12
您尚未正确配置FastMM4Options.inc
.从分发版本4.97的文件开始,它位于第405行:
{Set this option to require the presence of the Delphi IDE to report memory
leaks. This option has no effect if the option "EnableMemoryLeakReporting"
is not also set.}
{.$define RequireIDEPresenceForLeakReporting}
Run Code Online (Sandbox Code Playgroud)
确保.
它位于最后一行(之前$define
)并重建项目.
@wades发现还有另一个设置,紧接在我提到的设置之下RequireDebuggerPresenceForLeakReporting
,默认为打开.通过在左括号后添加句点来禁用它:
{Set this option to require the program to be run inside the IDE debugger to
report memory leaks. This option has no effect if the option
"EnableMemoryLeakReporting" is not also set.}
{$define RequireDebuggerPresenceForLeakReporting}
Run Code Online (Sandbox Code Playgroud)
(通过@wades的请求添加此答案.)