X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind%2FSession.pm;h=6c2a16c3fd2f190b957708769d9e886d0b325c23;hb=a7f76c8c630e9273e6b8c72f884e7fe012da116e;hp=81f195654edd8cf5fd6d93716d11ca8d5232b5e9;hpb=90b6c795c9fab6343c3501923aacc8f43f7a82ea;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind/Session.pm b/lib/Test/Valgrind/Session.pm index 81f1956..6c2a16c 100644 --- a/lib/Test/Valgrind/Session.pm +++ b/lib/Test/Valgrind/Session.pm @@ -177,7 +177,7 @@ sub run { my %args = @_; $self->start(%args); - my $guard = bless sub { $self->finish } => 'Test::Valgrind::Session::Guard'; + my $guard = Test::Valgrind::Session::Guard->new(sub { $self->finish }); $self->_run($args{command}); } @@ -271,7 +271,9 @@ sub _run { return; } -sub Test::Valgrind::Session::Guard::DESTROY { $_[0]->() } +sub Test::Valgrind::Session::Guard::new { bless \($_[1]), $_[0] } + +sub Test::Valgrind::Session::Guard::DESTROY { ${$_[0]}->() } =head2 C @@ -491,7 +493,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2009 Vincent Pit, all rights reserved. +Copyright 2009,2010 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.