- changed status to invalid
[FixInsight Warning] dwsExprs.pas(3322): W504 Missing INHERITED call in destructor
Issue #58
invalid
dwsExprs.pas Line 3322: W504 Missing INHERITED call in destructor
destructor TdwsProcedure.Destroy;
begin
FRootTable.Free;
FExpr.Free;
FInitExpr.Free;
FPreConditions.Free;
FPostConditions.Free;
end;
inherited call is missing, TdwsProgram.Destroy will not fire and free its objects.
Comments (3)
-
repo owner -
reporter OK. I guess that it is intentional that if TdwsProcedures constructor doesn't call inherited constructor, then it shouldn't call inherited destructor.
-
repo owner This is very much of an extreme corner case though, I would not make it a general rule. It could be refactored away by extending the class hierarchy, but this is not done here to allow replacing some "is" class checks by ".ClassType=" for performance purposes... Hence the "sealed" classes... So quite uncommon usage case :)
- Log in to comment
TdwsProcedures should not free all the objects as TdwsProgram does, as it does not own all of them.