I agree with what you say, no arguments there, but it's a very good
question. As I have often wondered if these memory leaks only relate to the
life time of the application. Somewhere in the past I am sure I read that
Windows will release all associate memory with that application (very
confusing). Maybe more so now with W2K. Can you say for sure that Windows
will not release this memory (owner created objects) once the program
closes.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Sergei Stenkov
Sent: Thursday, July 19, 2001 12:36 PM
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Destroying Objects


Ross,

> When an application exits in the normal way, does it automatically
> destroy all objects created at runtime?

No. You'll need to take care of them

var
  Obj: TObject;
begin
  Obj := TObject.Create;
  try

    // do what you need

  finally
    Obj.Free;
  end;
end;

Cheers,
Sergei Stenkov
---------------------------------------------------------------------------
    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/

Reply via email to