Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Detecting memory leaks.

by Steve_BZ (Chaplain)
on May 04, 2015 at 14:57 UTC ( [id://1125583]=note: print w/replies, xml ) Need Help??


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
    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.

    If $booking_dlg->{booking_main} contains a reference to $booking_dlg? Then this is a circular reference:

    $booking_dlg->{Ctl_Booking_Referring_Doctor_Txt} = i_staticText->new($ +booking_dlg->{booking_main}

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

      Oh, for a minute I got my hopes up!

      I did:

      $mu->record('at i_Booking exit'); $mu->dump(); print "Find cycle >>>>>>>>"; find_cycle($booking_dlg); print "<<<<<<<<<< Find cycle"; return $booking_dlg;

      And the

      find_cycle($booking_dlg);

      Did nothing.

      Oh Well.

      Regards

      Steve.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1125583]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-18 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found