Dws2Exprs.pas Memory Leak
Brought to you by:
hhernler,
mackermann
Dws2Exprs.pas:
On TContext.Destroy, the contents of the TList object
FSubContexts are destroyed but the TList object itself
isn't..
Original code:
destructor TContext.Destroy;
var
x: Integer;
begin
for x := 0 to FSubContexts.Count - 1 do
TContext(FSubContexts[x]).Free;
inherited;
end;
Replace it with this:
destructor TContext.Destroy;
var
x: Integer;
begin
for x := 0 to FSubContexts.Count - 1 do
TContext(FSubContexts[x]).Free;
FSubContexts.Free; { this is the missing line! }
inherited;
end;