mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
BUGFIX MSSQLDatabase::__destruct() should check if the db handle is a resource before attempting to close it, otherwise it'll give a warning about an invalid MSSQL link, when it should've said "unable to connect to server"
This commit is contained in:
parent
4c2cb7f3e9
commit
82dcbb89d2
@ -95,10 +95,12 @@ class MSSQLDatabase extends Database {
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
if($this->mssql) {
|
||||
mssql_close($this->dbConn);
|
||||
} else {
|
||||
sqlsrv_close($this->dbConn);
|
||||
if(is_resource($this->dbConn)) {
|
||||
if($this->mssql) {
|
||||
mssql_close($this->dbConn);
|
||||
} else {
|
||||
sqlsrv_close($this->dbConn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user