Hi Mattia,

Thanks for this.  Are they both the same?  Obviously one line is better than
two!

Regards

Steve


-----Original Message-----
From: Mattia Barbon [mailto:mattia.bar...@libero.it] 
Sent: 08 August 2009 04:50
To: Steve Cookson
Cc: wxperl-users@perl.org
Subject: Re: Destructors

Steve Cookson wrote:

   Hi,

> Thanks to everyone for their help.
> 
> Here is an answer that works:
> 
>             $self->{"Notebook_tab_1"}->DestroyChildren();
>             $self->{"Notebook"}->RemovePage(0);

   Doing it like this will leak the page object; unless you later reuse 
the window in Notebook_tab_1, the correct solution is either:


     $self->{"Notebook"}->DeletePage(0);

or

     $self->{"Notebook"}->RemovePage(0);
     $self->{"Notebook_tab_1"}->Destroy();

Regards,
Mattia

Reply via email to