delphi xe memory leak produced in WSDLLookup.pas

constructor TWSDLLookup.Create;
begin
  FLookup := TDictionary<string, Variant>.Create;
end;

destructor TWSDLLookup.Destroy;
begin
  ClearWSDLLookup;  //问题在这里
  inherited;
end;

改为:

constructor TWSDLLookup.Create;
begin
  FLookup := TDictionary<string, Variant>.Create;
end;

destructor TWSDLLookup.Destroy;
begin
  ClearWSDLLookup;
  FLookup.Free;  //加上这个
  inherited;
end;
原文地址:https://www.cnblogs.com/starluck/p/4561561.html