On Sat, Jun 13, 2009 at 12:45 PM, Andy Armstrong <andy@hexten.net> wrote:
> What I'm seeing is that with this code ( without the my (undef)... bodge ):
>
> sub leakguard(&@) {
> my $block = shift;
> my $state = My::Mem::State->new( @_ );
> my $rc = $block->();
> #my ( undef ) = ( $state );
> return $rc;
> }
>
> leakguard { my $foo = Foo->new };
>
> it seems that $state is DESTROYed /before/ $foo - which surprises me a
> little.
Do you get the same problem with
leakguard { my $foo = Foo->new; 1 };
Thread Previous
|
Thread Next