Skip to content

Commit

Permalink
explicitly call disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Mar 7, 2011
1 parent 6ca998d commit 389b018
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/DBIx/Skinny.pm
Expand Up @@ -253,8 +253,11 @@ sub do_on_connect {

sub disconnect {
my $class = shift;
$class->_attributes->{dbh} = undef;
$class->_attributes->{txn_manager} = undef;
delete $class->_attributes->{txn_manager};
if (my $dbh = delete $class->_attributes->{dbh}) {
local $@;
eval { $dbh->disconnect };
}
}

sub set_dbh {
Expand Down

0 comments on commit 389b018

Please sign in to comment.