Hi Guys, I started to talk about this on Perl Monks, you may have seen it here:
http://www.perlmonks.org/?node_id=1125580An anonymous monk posted some code that showed just about every call to Wx leaking a scalar or two. I've played about with the posted code and there is a copy attached to this email.
The main part of the code, here:
$count1 = Devel::Leak::NoteSV($handle);
for(1..100){
my $f=Wx::Frame->new( undef ,-1,"goner" );
my $p=Wx::Panel->new (undef ,-1 );
#my $b=Wx::Button->new ( $f ,-1 );
#my $t=Wx::TextCtrl->new($f, -1, "");
#$t->Destroy;
#$b->Destroy;
#$i->Destroy;
$p->Destroy;
$f->Destroy;
}
$count2 = Devel::Leak::CheckSV($handle);
seems to show that if you do not ->Destroy a Wx object, it will not go
out of scope naturally and even if you do destroy a Wx::Frame object, it
will not go out of scope. The monk also tried Weaken and undef, with
the same results.
Please have a look at this and make sure that I have not (or the Anonymous Monk has not), made some fundamental error.
I have checked it both in 2.8.11 and 3.0.2 with the same results. I look forward to hearing your feedback, Regards Steve.
perl_Leak_Mem_v2.pl
Description: Perl program
