SetOptions、GetOptions 或 foShowMemoryLeakReport Delphi

问题描述 投票:0回答:1
program Project1;

uses
  FastMM4,
  Vcl.Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
  // Ustaw opcje FastMM4, aby włączyć raport o wyciekach
  FastMM4.SetOptions(FastMM4.GetOptions + [foShowMemoryLeakReport]);

  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

我尝试在我的应用程序中显示泄漏,但没有返回任何消息。

[dcc32 Error] Project1.dpr(12): E2003 Undeclared identifier: 'SetOptions'
[dcc32 Error] Project1.dpr(12): E2003 Undeclared identifier: 'GetOptions'
[dcc32 Error] Project1.dpr(12): E2003 Undeclared identifier: 'foShowMemoryLeakReport'
delphi
1个回答
0
投票

请使用

System.ReportMemoryLeaksOnShutdown
来代替。

program Project1;

uses
  Vcl.Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

begin
  ReportMemoryLeaksOnShutdown := True;

  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
© www.soinside.com 2019 - 2024. All rights reserved.