Reporting memory leaks on shutdown with a console application

前端 未结 4 602
野的像风
野的像风 2021-01-11 21:56

I\'ve created a console application and set ReportMemoryLeaksOnShutdown := True.

I\'ve created a TStringList but did not free it.

When the program finishes

4条回答
  •  别那么骄傲
    2021-01-11 22:25

    var
      SaveExitProcessProc: procedure;
      s: TStringList;
    
    procedure MyExitProcessProc;
    begin
      ExitProcessProc := SaveExitProcessProc;
      readln;
    end;
    
    begin
      SaveExitProcessProc := ExitProcessProc;
      ExitProcessProc := MyExitProcessProc;
      ReportMemoryLeaksOnShutdown := True;
      s := TStringList.Create;
    end.
    

提交回复
热议问题