From 1665af184d6784c20ff60ac8eecdbdcc49eef36b Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 10 Apr 2009 16:31:54 +0000 Subject: [PATCH] Prevent closing dbh handles twice. --- lib/WebGUI/SQL.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/SQL.pm b/lib/WebGUI/SQL.pm index 372c1b31b..276e29896 100644 --- a/lib/WebGUI/SQL.pm +++ b/lib/WebGUI/SQL.pm @@ -503,9 +503,11 @@ Disconnects from the database. And destroys the object. =cut sub disconnect { - my $self = shift; - $self->dbh->disconnect; - undef $self; + my $self = shift; + my $dbh = delete $self->{_dbh}; + if ($dbh) { + $dbh->disconnect; + } }