Originally Posted by
Darkhog
I have proper destructors for all my classes and at the end of program I .Destroy() them, but do I also have to execute .Free() afterwards?
Free is simply a safe way to call Destroy (it checks first if it exists). So no, don't call both. In the implementation:
Code:
procedure TObject.Free;
begin
// the call via self avoids a warning
if self<>nil then
self.destroy;
end;
Bookmarks