Quote Originally Posted by pjpdev
Quote Originally Posted by User137
This caught my eye. Using .Destroy calls in main program is bad habit
Delphi help says: "Do not call Destroy directly. Call Free instead. Free verifies that the object reference is not nil before calling Destroy."
I would have called .Destroy , but now I know that calling free is a more effective way.
Well I don't think it's more effective. On contrary it may just be a little less effective. As the help says, Free checks that the object reference isn't nil and then calls Destroy. So I suppose Free just looks something like this (perhaps a bit more advanced code)
Code:
if Object <> nil then
Object.Destroy;