Prevent closing dbh handles twice.
This commit is contained in:
parent
75ad1c14ff
commit
1665af184d
1 changed files with 5 additions and 3 deletions
|
|
@ -503,9 +503,11 @@ Disconnects from the database. And destroys the object.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub disconnect {
|
sub disconnect {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->dbh->disconnect;
|
my $dbh = delete $self->{_dbh};
|
||||||
undef $self;
|
if ($dbh) {
|
||||||
|
$dbh->disconnect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue