org.sonar.l10n.delphi.rules.community-delphi.AssignedAndFree.html Maven / Gradle / Ivy
The newest version!
Why is this an issue?
The TObject.Free
method already performs a nil check before freeing. Additional
checks are redundant.
How to fix it
Remove the nil check:
if Assigned(Foo) then begin
Foo.Free;
end;
if Bar <> nil then begin
FreeAndNil(Bar);
end;
Foo.Free;
FreeAndNil(Bar);
Resources
© 2015 - 2024 Weber Informatics LLC | Privacy Policy