From 41fca795ebc43f83746c6e3b965b03330690314e Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 23 Jan 2008 21:34:16 +0000 Subject: Only disconnect the database handle during Wallet::Server object destruction if the database handle hasn't already been destroyed. --- perl/Wallet/Server.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/perl/Wallet/Server.pm b/perl/Wallet/Server.pm index 96cff15..e0c0f29 100644 --- a/perl/Wallet/Server.pm +++ b/perl/Wallet/Server.pm @@ -71,7 +71,9 @@ sub error { # Disconnect the database handle on object destruction to avoid warnings. sub DESTROY { my ($self) = @_; - $self->{dbh}->disconnect unless $self->{dbh}->{InactiveDestroy}; + if ($self->{dbh} and not $self->{dbh}->{InactiveDestroy}) { + $self->{dbh}->disconnect; + } } ############################################################################## -- cgit v1.2.3