diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-05-22 23:37:04 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-05-22 23:37:04 +0200 |
commit | 32593f9aa821a80f5e9fc2dbbae0b4f5f1078dd8 (patch) | |
tree | d56ffd0a88bf04cbdb205876be99473b0f22ecf9 /system/database | |
parent | 1d79efea47d26e0e567f919c648adf5b554f3ff0 (diff) | |
parent | 89f77eedf9118dfccd52a7bc3e559d6bac5aa07c (diff) |
Merge pull request #1378 from gintsmurans/develop
Move closing of database connection to CI_DB_driver->__destruct - #1376
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/DB_driver.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index ef77b594e..a955f45d2 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1390,6 +1390,23 @@ abstract class CI_DB_driver { { } + // -------------------------------------------------------------------- + + /** + * Destructor + * + * Closes the database connection, if needed. + * + * @return void + */ + public function __destruct() + { + if ($this->conn_id && ! $this->pconnect) + { + $this->close(); + } + } + } /* End of file DB_driver.php */ |