Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Rule suggestion - Free never called on object

 Post Reply Post Reply
Author
Vincent Parrett View Drop Down
New Member
New Member
Avatar

Joined: 01 Dec 2017
Posts: 4
Post Options Post Options   Quote Vincent Parrett Quote  Post ReplyReply Direct Link To This Post Topic: Rule suggestion - Free never called on object
    Posted: 01 Dec 2017 at 12:47am
Not sure if this is possible, but I just found a memory leak that might have been caught with static analysis :

constructor TProjectParameterCollection.Create;
begin
  inherited Create;
  FParameters := TList<IProjectParameter>.Create;
end;

destructor TProjectParameterCollection.Destroy;
begin
  Clear;
  FParameters := nil; // << should be FParameters.Free;
  inherited;
end;

I guess the rule could be defined as ".Free never called on object" ?? 

Just an idea. 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down