Report leak by email or on file

delphi package - automated exception handling
Post Reply
qprotex
Posts: 3
Joined: Thu Oct 04, 2018 1:51 pm

Report leak by email or on file

Post by qprotex »

Hello,

I am using the report leak functionality of madExcept and it worked after I copied the madExept32.dll to the folder with the exe (For some reason did not work automatically)

Question: The report leak does not seem to be sent by email or written into a file automatically using the exception configuration settings. Is there any way to get that info by email or in a file?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Report leak by email or on file

Post by madshi »

The leak reporting is meant to be used mainly on your development machine. It's not intended to be run on an end user's PC. The reason for that is that leak reporting eats additional performance and a lot of extra RAM. So it's usually not a good thing to do at an end user's PC. And that's the reason why there's no automatic way to send a leak reporting via email. Another reason is that leak reporting is done after all your unit finalization sections already have run through, so that means there's a limit to what madExcept can still do.

Of course if you want to run leak reporting on an end user's PC and send the leak report to yourself automated somehow, it's possible to achieve, just needs a bit of extra work on your side.

What you can do is call the following API, exported by madExcept.pas:

Code: Select all

// Force leak reporting to save the report to a specific file.
// The report will always be saved and not displayed in the viewer.
procedure SetLeakReportFile (const leakReportFile: UnicodeString);
If you do this, the leak report is saved to a file when your EXE ends. However, it's not sent via email, because your EXE is already finalized at that point in time. However, the next time your EXE starts, it can check if a leak report was saved and then manually send it to you.

Hope that helps?
Post Reply