For a web framework I tried anonymous methods for the first time and ran into a problem with the memory management.

How can this memory leak (Delphi 2009) get fixed?

The leak message is:

> 
> 13 - 20 bytes: Project27$ActRec x 1
> 
> 
> 

```
program Project27;

type
  TTestProc = reference to procedure;

  procedure CallMe(Proc: TTestProc);
  begin
  end;

begin
  CallMe(procedure begin end);

  ReportMemoryLeaksOnShutdown := True;
end.

```

---

The same leak message "Project27$ActRec x 1" appears no matter how many anonymous methods are between begin and end, I guess that the leak is for the TTestProc type, not the individual anonymous procedures

```
program Project27;

type
  TTestProc = reference to procedure;

  procedure CallMe(Proc: TTestProc);
  begin
  end;

begin

  ReportMemoryLeaksOnShutdown := True;

  CallMe(procedure begin end);

  CallMe(procedure var A: Integer; begin A := 42 ; end);

end. 

```