X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FCursor.pm;h=92e870201d44a1b3683629a3b6a83bfc15d4d488;hb=9c1700e39e6ee002d9294c0d988882d1f0d7d86f;hp=352ba089bca8be0004cf385269a62d016352dd4c;hpb=52b420dd006f55aced42c669f49182890b8826ea;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Cursor.pm b/lib/DBIx/Class/Storage/DBI/Cursor.pm index 352ba08..92e8702 100644 --- a/lib/DBIx/Class/Storage/DBI/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/Cursor.pm @@ -6,9 +6,10 @@ use warnings; use base qw/DBIx::Class::Cursor/; use Try::Tiny; +use namespace::clean; __PACKAGE__->mk_group_accessors('simple' => - qw/sth/ + qw/sth storage args pos attrs _dbh_gen/ ); =head1 NAME @@ -176,11 +177,10 @@ sub _check_dbh_gen { } sub DESTROY { - my ($self) = @_; - # None of the reasons this would die matter if we're in DESTROY anyways - try { $self->sth->finish } - if $self->sth && $self->sth->{Active}; + if (my $sth = $_[0]->sth) { + try { $sth->finish } if $sth->FETCH('Active'); + } } 1;