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.
In reply to Re^2: Detecting memory leaks.
by Steve_BZ
in thread Detecting memory leaks.
by Steve_BZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |