File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -393,15 +393,5 @@ function &get_instance()
393
393
*/
394
394
$ EXT ->call_hook ('post_system ' );
395
395
396
- /*
397
- * ------------------------------------------------------
398
- * Close the DB connection if one exists
399
- * ------------------------------------------------------
400
- */
401
- if (class_exists ('CI_DB ' ) && isset ($ CI ->db ) && ! $ CI ->db ->pconnect )
402
- {
403
- $ CI ->db ->close ();
404
- }
405
-
406
396
/* End of file CodeIgniter.php */
407
397
/* Location: ./system/core/CodeIgniter.php */
Original file line number Diff line number Diff line change @@ -1390,6 +1390,23 @@ protected function _reset_select()
1390
1390
{
1391
1391
}
1392
1392
1393
+ // --------------------------------------------------------------------
1394
+
1395
+ /**
1396
+ * Destructor
1397
+ *
1398
+ * Closes the database connection, if needed.
1399
+ *
1400
+ * @return void
1401
+ */
1402
+ public function __destruct ()
1403
+ {
1404
+ if ($ this ->conn_id && ! $ this ->pconnect )
1405
+ {
1406
+ $ this ->close ();
1407
+ }
1408
+ }
1409
+
1393
1410
}
1394
1411
1395
1412
/* End of file DB_driver.php */
You can’t perform that action at this time.
0 commit comments