mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
BUGFIX Ensure that dbConn is a resource before attempting to close it
This commit is contained in:
parent
8b3f4f9963
commit
915457b86b
@ -95,7 +95,7 @@ class MSSQLDatabase extends Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
if($this->dbConn) {
|
if(is_resource($this->dbConn)) {
|
||||||
if(function_exists('mssql_close')) {
|
if(function_exists('mssql_close')) {
|
||||||
mssql_close($this->dbConn);
|
mssql_close($this->dbConn);
|
||||||
} elseif(function_exists('sqlsrv_close')) {
|
} elseif(function_exists('sqlsrv_close')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user