The simple answer is NO.
When using the Visual (eg TControl and upwards) framework that Delphi
provides the answer is that the owner of an object (not the parent) is
responsible for the objects destruction. Note that in the parent hierarchy,
the parent is responsible for getting it's child components drawn, but
owner/lifetime management is controlled by the owner hierarchy.
If you provide no owner eg TControl.Create(nil), then you must explicitly
Free the object somewhere later in your code.
For the rest of the components that Delphi provides, you need to know who is
responsible for freeing/destroying objects. eg TList does not destroy
objects (it does not know what is storing), however TCollection does.
Myles.
-----Original Message-----
From: Ross Levis [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 19 July 2001 12:26 p.m.
To: Multiple recipients of list delphi
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/