I think it is dangerous to take too much comfort
in the knowledge that Windows will return resources
after an application exits.
If you have a TForm that is repeatedly created and
destroyed during the life of an application, the
controls on that form will be destroyed each time
the form is destroyed. But OTHER objects created
by this form won't be (for examples objects you
added to a TList) and you could run into resource
problems if the application runs for a long enough
time without exiting.
Granted - it technically isn't a "resource leak"
- but that won't make your user any happier.
-ns
----- Original Message -----
From: "Alex Kouznetsov" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 9:09 AM
Subject: Re: [DUG]: Destroying Objects
> I have had an impression that with latest versions of Windows, when an
> application exits, absolutelly all the memory it has allocated is
freed by
> OS.
>
> Alex
>
> ----- Original Message -----
> From: "Sergei Stenkov" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Thursday, 19 July 2001 10:36
> 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/
>
---------------------------------------------------------------------------
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/