* Mac Mini M1
* macOS 14.6.1
* Windows 11 Pro (runnings as a VM in VMWare Fusion)
* Lazarus 3.99
* FPC 3.3.1
I was using Heaptrc to track some memory leaks a few days ago. I bypassed the Debug code in my project file...
program osmosepresets;
{$mode objfpc}{$H+}
{.$DEFINE debug} // "." suppreses debug definition
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
caMidi,
caMidiIntf,
caMidiTypes,
Interfaces, // this includes the LCL widgetset
SysUtils,
Forms,
uMainForm,
uData,
uSettingsForm,
uSettingsData;
//{$R *.res}
{$IFDEF DEBUG}
const HeaptrcPath = '/Users/carlcaulkett/Code/FPC/OsmosePresets/heaptrc.txt';
{$ENDIF DEBUG}
begin
{$IFDEF DEBUG}
// Assuming your build mode sets -dDEBUG in Project Options/Other when defining -gh
// This avoids interference when running a production/default build without -gh
// Set up -gh output for the Leakview package:
if FileExists(HeaptrcPath) then
DeleteFile(HeaptrcPath);
SetHeapTraceOutput(HeaptrcPath);
{$ENDIF DEBUG}
RequireDerivedFormResource := True;
Application.Scaled := True;
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.
I also unchecked the option in "Project Options" -> "Compiler Options" -> "Debugging" -> "Use Heaptrc unit (check for mem-leaks) (-gh)"
Yet when I run the app as a cross-compiled Windows app, when I terminate it, I get 5 pages of what look like memory address. Noticeably, on the second page, Heaptrc is mentioned, despite my attempts to stop it being used...
How can I suppress this display of memory addresses?
And please don't tell me that, it's for my own good, and that I should get rid of the memory leaks. That process is in hand by other means!