freeandnil

The address of a property: what the Delphi compiler does with @, var and FreeAndNil

This article is one chapter of my book Delphi in all its glory – For more than mere programmers, the first book of the series. Want to see what the compiler really does with a property? Ask for its address. Below, Obj.Prop is a read-only property that either reads the field FProp directly or calls […]

The address of a property: what the Delphi compiler does with @, var and FreeAndNil Read More »

Again on FreeAndNil – A meaningless debate?

Recently, I came across a forum where somebody described FreeAndNil as an “abomination” and I think that’s a bit over the top. Let’s unpack this topic carefully, with technical clarity and an eye for proportion. FreeAndNil(SomeObject) is just syntactic sugar for: if SomeObject <> nil then begin SomeObject.Free; SomeObject := nil; end; The actual implementation

Again on FreeAndNil – A meaningless debate? Read More »

Scroll to Top