org.sonar.l10n.delphi.rules.community-delphi.FreeAndNilTObject.html Maven / Gradle / Ivy
Why is this an issue?
The argument passed to FreeAndNil
must be an instance of a TObject descendant.
Prior to Delphi 10.4, the signature for FreeAndNil
is untyped. This erroneously
loose contract allows any variable to be passed into FreeAndNil
, which will cause
a runtime exception.
How to fix it
Remove the incorrect call to FreeAndNil
- non-object types are either managed or
have an alternative way of freeing associated memory.
Resources
© 2015 - 2024 Weber Informatics LLC | Privacy Policy