delphi - 将结果从 ReportMemoryLeaksOnShutdown 重定向到日志文件

标签 delphi

我想将内存泄漏检测添加到我们的自动化单元测试中。 ReportMemoryLeaksOnShutdown 将检测任何内存泄漏。最大的问题是它将结果打印到模式对话框中,该对话框必须由用户手动关闭。这在构建服务器上运行的自动化单元测试中不起作用。

有没有办法将 ReportMemoryLeaksOnShutdown 的输出重定向到其他地方?比如将信息打印到文件中?

文档说:

the Memory Manager will scan the memory pool when it shuts down and report all unregistered memory leaks in a message dialog.

我使用的是Delphi 2010

最佳答案

下载FastMM4的完整版本来自sourceforge。您可以将其配置为写入 FastMM4Options.inc 中的日志文件;只需查看下载中的自述文件和常见问题解答文件即可了解详细信息。具体来说,请查找有关 FullDebugModeLogErrorsToFile 的信息,以及常见问题解答自述文件中的第三或第四个问题。

关于delphi - 将结果从 ReportMemoryLeaksOnShutdown 重定向到日志文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5399395/

相关文章:

delphi - 帕斯卡 : Delphi Length String Command Error

delphi - 如何使用 Delphi DBExpress 监听 Firebird 事件

delphi - 用于在Intraweb VCL中使https工作的pem文件对于Web

delphi - 如何使用Delphi在运行时创建一个对所有用户具有完全权限的目录?

delphi - 将 TCombobox 列添加到 Firemonkey TGrid

delphi - 重新声明自定义 Delphi 组件的 Width 属性

delphi - VCL 表单应用程序和控制面板小程序有什么区别

delphi - 我应该如何创建唯一的账单/帐号?

Delphi/pascal 将字符串解析为组合框

delphi - 如何将Windows消息发送到非主要形式