The FreeAndNil discussion never stops. I decided to add my twopence. How about this: {.$DEFINE FREEANDNIL} {$IFDEF FREEANDNIL} procedure FreeObj(var Obj); inline; begin FreeAndNil(Obj); end; {$ELSE} procedure FreeObj(Obj: TObject); inline; begin Obj.Free; end; {$ENDIF} With FreeObj procedure ...
More...