From 76b65f0ce176e0162bc7eedef951d37e96179ee2 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 11 Dec 2009 05:59:45 +0100 Subject: tried to close the db connection clean --- paste/include/storage/MysqlStorage.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/paste/include/storage/MysqlStorage.php b/paste/include/storage/MysqlStorage.php index 4c713bc..bae4855 100644 --- a/paste/include/storage/MysqlStorage.php +++ b/paste/include/storage/MysqlStorage.php @@ -71,8 +71,11 @@ INDEX (nick) function __destruct() { - if (is_instance_of($this->mysql, 'mysqli')) - $this->mysql->close(); + if (is_null($this->mysql)) + return; + + $this->mysql->close(); + $this->mysql = null; } public function setContent($content, $language, $nick, $description) @@ -119,9 +122,9 @@ INDEX (nick) die('No such paste'); } - echo PastifyText($content, $lang, $description); - $shmt->close(); + + echo PastifyText($content, $lang, $description); } } } -- cgit v1.2.3