diff options
author | Russ Allbery <rra@stanford.edu> | 2008-01-23 21:34:16 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-01-23 21:34:16 +0000 |
commit | 41fca795ebc43f83746c6e3b965b03330690314e (patch) | |
tree | 5af044dd463a06c83319d1c570ee10508fe7d4bb /perl | |
parent | 61d48fd55da2f533df4020b7130d58e6104aadbc (diff) |
Only disconnect the database handle during Wallet::Server object
destruction if the database handle hasn't already been destroyed.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Wallet/Server.pm | 4 |
1 files changed, 3 insertions, 1 deletions
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; + } } ############################################################################## |