Re: Newbie question about release, freeAndNil, etc
- From: "e.p" <e.p@xxxxxxxxxxxxxxx>
- Date: Fri, 26 Aug 2005 12:39:40 +0300
Maarten Wiltink wrote:
>
> The forms should preferably register and unregister themselves
> with this list from the constructor and destructor, and be
> free-on-close so you don't go nuts juggling them. Basically,
> the single variable is replaced by a collection.
Does TCollection have some code that has that kind of free-on-close
property for Forms, or what is all that? I have never used TCollections,
I wonder if someone has code snippets how to use it with Forms.
A 'free-on-close' property for any Forms might be useful, but at least
my D6 version does not recognize it.
> however it's part of the pattern of "fire and forget" that the form
> should be defined to
> clean up after itself. The responsibility is not shifted just
> anywhere but to the (visual) object _itself_.
Just when I have learned the disciplided technics to always free all my
created Forms within the same program block where the Form was created:)
At the same time I abandoned the Release schema I had learned on the old
D1 days:
frmViewerOptions.showModal;
begin
//stuff
frmViewerOptions.release;
frmViewerOptions := nil;
end;
How is it, does the use of TCollection bring here some totally new, more
user friendly, "Java style", use-and-forget technique?
e.p
.
- Follow-Ups:
- Re: Newbie question about release, freeAndNil, etc
- From: Maarten Wiltink
- Re: Newbie question about release, freeAndNil, etc
- From: alanglloyd@xxxxxxx
- Re: Newbie question about release, freeAndNil, etc
- References:
- Newbie question about release, freeAndNil, etc
- From: swansnow
- Re: Newbie question about release, freeAndNil, etc
- From: Maarten Wiltink
- Newbie question about release, freeAndNil, etc
- Prev by Date: Re: OOP style
- Next by Date: Re: Newbie question about release, freeAndNil, etc
- Previous by thread: Re: Newbie question about release, freeAndNil, etc
- Next by thread: Re: Newbie question about release, freeAndNil, etc
- Index(es):