It would be nice to answer with a simple rule like
"if you create it you must destroy it"
But it doesn't work like that.
For example, TComponent objects explicitly created in your
program are automatically destroyed by their owner's
destructor - so you don't generally destroy them (and
in fact can cause problems sometimes if you do).
An exception to my exception above are TComponents created
with nil owners. Those need to be cleaned up explicitly.
-ns
----- Original Message -----
From: "Ross Levis" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 7:25 AM
Subject: [DUG]: Destroying Objects
> A simple question.
>
> When an application exits in the normal way, does it automatically
> destroy all objects created at runtime?
>
> Cheers,
> Ross.
>
>
> ----------------------------------------------------------------------
-----
> New Zealand Delphi Users group - Delphi List -
[EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/