in reply to Re: Detecting memory leaks.
in thread Detecting memory leaks.
Hi BrowserUK,
Thanks for that. A sensible suggestion. I just did that and made a global replace. I also moved the Wx::Font line before the rest of the code, like this:
my $loc_font_wx=Wx::Font->new($gl_cfg->{client_point_size}, wxMODE +RN, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, 0, $gl_cfg->{client_font}) +; $mu->record('after i_Booking set focus'); # Referring Dr details from Dr file $booking_dlg->{Ctl_Booking_Referring_Doctor_Lbl} = Wx::StaticText- +>new($booking_dlg->{booking_main}, wxID_ANY, __t('Referring Doctor'), + wxDefaultPosition, wxDefaultSize, ); $mu->record('before i_Booking i_staticText 1'); $booking_dlg->{Ctl_Booking_Referring_Doctor_Txt} = i_staticText->n +ew($booking_dlg->{booking_main}, wxID_ANY, "", wxDefaultPosition, wxD +efaultSize, ); $mu->record('after i_Booking i_staticText 1'); $booking_dlg->{Ctl_Booking_Referring_Doctor_Txt}->SetFont($loc_fon +t_wx); $mu->record('before i_Booking Ctl_Booking_Referring_Doctor_Ref_4_L +bl'); $booking_dlg->{Ctl_Booking_Referring_Doctor_Ref_4_Lbl} = Wx::Stati +cText->new($booking_dlg->{booking_main}, wxID_ANY, __t("Ref 4"), wxDe +faultPosition, wxDefaultSize, ); $mu->record('before i_Booking i_staticText 2'); $booking_dlg->{Ctl_Booking_Referring_Doctor_Ref_4_Txt} = i_staticT +ext->new($booking_dlg->{booking_main}, wxID_ANY, "", wxDefaultPositio +n, __xy_size(100), ); $mu->record('after i_Booking i_staticText 2'); $booking_dlg->{Ctl_Booking_Referring_Doctor_Ref_4_Txt}->SetFont($l +oc_font_wx);
The output is unchanged:
0 773984 ( 0) 193264 ( 0) 43436 ( 0) 8 ( +0) 368884 ( 0) after i_Booking set focus 0 773984 ( 0) 193264 ( 0) 43436 ( 0) 8 ( +0) 368884 ( 0) before i_Booking i_staticText 1 0 773984 ( 0) 193264 ( 0) 43436 ( 0) 8 ( +0) 368884 ( 0) after i_Booking i_staticText 1 0 774604 ( 620) 193264 ( 0) 43436 ( 0) 8 ( +0) 368884 ( 0) before i_Booking Ctl_Booking_Referring_Doctor_Ref +_4_Lbl
But even so, the variable should be destroyed when it moves out of scope and it is not, so I suspect some sort of circular reference. I just can't see it.
Steve.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Detecting memory leaks.
by BrowserUk (Patriarch) on May 04, 2015 at 16:04 UTC | |
by Steve_BZ (Chaplain) on May 04, 2015 at 16:53 UTC | |
by Anonymous Monk on May 05, 2015 at 00:05 UTC | |
by Steve_BZ (Chaplain) on May 05, 2015 at 07:09 UTC | |
by Anonymous Monk on May 05, 2015 at 08:06 UTC | |
|