detect at runtime if leak detection is active

delphi package - automated exception handling
Post Reply
zbeleh
Posts: 15
Joined: Tue Jan 19, 2021 7:14 pm

detect at runtime if leak detection is active

Post by zbeleh »

As was mentioned in other threads, even if leak detection is programmatically enabled (in the mes file), detection will not be truly active if the madexcept32.dll is not found.

Is there a way to detect whether leak detection is truly active and taking place (enabled in .mes, and DLL found) at runtime?

thanks!
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: detect at runtime if leak detection is active

Post by madshi »

You can check "MESettings().ReportLeaks" to see if it's enabled, and you can use GetModuleHandle('madExcept32.dll') to check if the leak reporting DLL is currently loaded in your process. For 64bit, look for madExcept64.dll.
Post Reply