examples/leak_test
raw| 1 | #!/usr/local/bin/perl -w |
| 2 | |
| 3 | use Tk; |
| 4 | use Devel::Leak; |
| 5 | use Tk::widgets qw(Button); |
| 6 | print STDERR "Before ",$start = Devel::Leak::NoteSV($hook),"\n"; |
| 7 | { |
| 8 | my $top = MainWindow->new(); |
| 9 | my $w = $top->Button(-text => 'Quit',-command => ['destroy',$top])->pack; |
| 10 | MainLoop; |
| 11 | } |
| 12 | |
| 13 | END |
| 14 | { |
| 15 | print STDERR "After ",$end = Devel::Leak::CheckSV($hook),"\n"; |
| 16 | print "Delta ",($end-$start),"\n"; |
| 17 | } |
| 18 | |
| 19 |