X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FCursor.pm;h=eee5cbbb2232e6495da5ac84a9d26585cafee26e;hb=64ae166780d0cb2b9577e506da9b9b240c146d20;hp=b2c13543e44d05e7000615036022646dee6b649e;hpb=5d9c76e106f9ac8929bf1dddeeb157bed8d404ac;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Cursor.pm b/lib/DBIx/Class/Storage/DBI/Cursor.pm index b2c1354..eee5cbb 100644 --- a/lib/DBIx/Class/Storage/DBI/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/Cursor.pm @@ -3,11 +3,10 @@ package DBIx::Class::Storage::DBI::Cursor; use strict; use warnings; -use base qw/ - Class::Accessor::Grouped - DBIx::Class::Cursor -/; -use mro 'c3'; +use base qw/DBIx::Class::Cursor/; + +use Try::Tiny; +use namespace::clean; __PACKAGE__->mk_group_accessors('simple' => qw/sth/ @@ -154,7 +153,8 @@ sub reset { my ($self) = @_; # No need to care about failures here - eval { $self->sth->finish if $self->sth && $self->sth->{Active} }; + try { $self->sth->finish } + if $self->sth && $self->sth->{Active}; $self->_soft_reset; return undef; } @@ -177,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 - local $@; - eval { $self->sth->finish if $self->sth && $self->sth->{Active} }; + if (my $sth = $_[0]->sth) { + try { $sth->finish } if $sth->FETCH('Active'); + } } 1;