mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-03 22:58:24 +02:00
Merge pull request #5778 from assertchris/check-for-resource-before-closing-mysql-connection
Checking for resource before closing MySQL connection
This commit is contained in:
commit
1c4900969f
@ -96,7 +96,7 @@ class MySQLiConnector extends DBConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
if ($this->dbConn) {
|
if (is_resource($this->dbConn)) {
|
||||||
mysqli_close($this->dbConn);
|
mysqli_close($this->dbConn);
|
||||||
$this->dbConn = null;
|
$this->dbConn = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user