 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Victor Jetten Guest
|
Posted: Fri Nov 07, 2003 8:44 am Post subject: newby inheritance question |
|
|
hi,
I have an empty TPageControl on a form called EditPageControl. When the user
loads a textfile a TTabsheet is created:
TTabSheet *PCRScript = new TTabSheet(EditPageControl);
then I create a new TSynEdit object linked to the tabsheet:
TSynEdit *Editor = new TSynEdit(PCRScript);
and a label which I ned for certain stuff:
TLabel *FileName = new TLabel(PCRScript);
when the user closes it all I do is:
delete EditPageControl->ActivePage;
Does this delete all the stuff ("children"?) linked to it (sorry I don't
know the correct terms) ?
thanks
Victor Jetten
|
|
| Back to top |
|
 |
Greg Bryant Guest
|
Posted: Sat Nov 08, 2003 1:32 pm Post subject: Re: newby inheritance question |
|
|
"Victor Jetten" <v.jetten (AT) geog (DOT) uu.nl> wrote in
news:bofm4f$erh$1 (AT) reader10 (DOT) wxs.nl:
| Quote: | hi,
I have an empty TPageControl on a form called EditPageControl. When
the user loads a textfile a TTabsheet is created:
TTabSheet *PCRScript = new TTabSheet(EditPageControl);
then I create a new TSynEdit object linked to the tabsheet:
TSynEdit *Editor = new TSynEdit(PCRScript);
and a label which I ned for certain stuff:
TLabel *FileName = new TLabel(PCRScript);
when the user closes it all I do is:
delete EditPageControl->ActivePage;
Does this delete all the stuff ("children"?) linked to it (sorry I
don't know the correct terms) ?
thanks
Victor Jetten
|
VCL controls are typically pretty good at cleaning up after themselves
(at least the Borland ones seem to be). The problems come with classes
that allocate memory for something, and then don't destroy it in the
destructor. You can try turning on CodeGuard for a little while (don't
forget to turn it back off to see if it catches anything not being
freed properly.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|