DebugHook 与 ReportMemoryLeaksOnShutdown


DebugHook 与 ReportMemoryLeaksOnShutdown 都是 System 下的变量.

DebugHook: 程序中母体中运行时, 此值是 1; 独立运行时, 它是 0.

在程序的任何地方加上一句 ReportMemoryLeaksOnShutdown := True;
这样程序在关闭时可检测是否有内存泄漏.

如果这样使用: ReportMemoryLeaksOnShutdown := Boolean(DebugHook);
则程序只会在调试时报内存泄漏.
原文地址:https://www.cnblogs.com/del/p/1625664.html