When to use object.free and freeandnil (object);

Possible duplicate:
Which is preferable: Free or FreeAndNil?

when to use free and free and informal?

in my way, I usually use .free when the created object is something like "object.create;" which does not matter self or nil. if there is, then I will use freeandnil ();

Am I doing it right? or does he have a lot of respect?

+4
source share
1 answer

FreeAndNil sometimes works against you; see the β€œ case against FreeAndNil ” article from Allen Bauer (chief scientist at Embarcadero) about using FreeAndNil and the subsequent article, which he called β€œthe case where FreeAndNil is your opponent .”

Note that FreeAndNil is not bad, but you need to know what it does to control its effects.

- Jeroen

+2
source

All Articles