mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:00:16 +00:00
explicitly close db connections - do not rely on process exit
This commit is contained in:
parent
308d98f7ac
commit
1a4a6b5ff9
3 changed files with 12 additions and 1 deletions
1
boot.php
1
boot.php
|
@ -989,6 +989,7 @@ function autoname($len) {
|
|||
if(! function_exists('killme')) {
|
||||
function killme() {
|
||||
session_write_close();
|
||||
closedb();
|
||||
exit;
|
||||
}}
|
||||
|
||||
|
|
|
@ -213,3 +213,12 @@ function dbesc_array(&$arr) {
|
|||
array_walk($arr,'dbesc_array_cb');
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
if(! function_exists('closedb')) {
|
||||
function closedb() {
|
||||
global $db;
|
||||
if($db && $db->connected)
|
||||
$db->close();
|
||||
}}
|
||||
|
||||
|
|
|
@ -326,4 +326,5 @@ else
|
|||
require_once(str_replace($lang . '/', '', $template));
|
||||
|
||||
session_write_close();
|
||||
closedb();
|
||||
exit;
|
||||
|
|
Loading…
Reference in a new issue