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;

 

posted @ 2015-06-08 17:46  不能失败  阅读(209)  评论(0编辑  收藏  举报