FastMM and implicit dll are delayed

I am using delphi XE2 with FastMM4. When I want to create a DLL with the keyword "Delayed", I have a violation when exiting the application. If I test without "Delay", I can leave the application without violation.

Main code:

type
    function Add(X, Y : Integer) : Integer; overload; stdcall external 'MaDll.dll' delayed;
var
   Form3 : TForm3;

implementation

{$R *.dfm}

procedure TForm3.Button1Click(Sender : TObject);
begin
   try
      showmessage(IntToStr(Add(10, 5)));
   except
      on e : Exception do
         showmessage(e.Message);
   end;
end;

end.

Dll Code:

library MaDll;

uses
  FastMM4,
  System.SysUtils,
  System.Classes;

{$R *.res}

function Add(X, Y : Integer) : Integer; stdcall;
begin
   Result := X + Y
end;

exports
   Add;

begin

end.

Is there a parameter in FastMM?

+4
source share

Source: https://habr.com/ru/post/1539570/


All Articles