]> git.mxchange.org Git - friendica.git/commitdiff
explicitly close db connections - do not rely on process exit
authorFriendika <info@friendika.com>
Wed, 6 Jul 2011 00:45:33 +0000 (17:45 -0700)
committerFriendika <info@friendika.com>
Wed, 6 Jul 2011 00:45:33 +0000 (17:45 -0700)
boot.php
include/dba.php
index.php

index c95e24dc1c889e7c0d00e8ca7c571e0d99213984..5efba4acc7ba39b891dbd69ce83a0f40c8b395f7 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -989,6 +989,7 @@ function autoname($len) {
 if(! function_exists('killme')) {
 function killme() {
        session_write_close();
+       closedb();
        exit;
 }}
 
index 49b325cf7b544dfe72a79f210cfe992359f793a0..32f1ac3edb9e0c005aacf242527d53e68215359f 100644 (file)
@@ -212,4 +212,13 @@ function dbesc_array(&$arr) {
        if(is_array($arr) && count($arr)) {
                array_walk($arr,'dbesc_array_cb');
        }
-}}             
\ No newline at end of file
+}}             
+
+
+if(! function_exists('closedb')) {
+function closedb() {
+       global $db;
+       if($db && $db->connected)
+               $db->close();
+}}
+
index 2e24c5b015c3130fafba4d9df2ea5a51e449bc13..a0a0bc7795977f21afaceb357fac620b80fc9270 100644 (file)
--- a/index.php
+++ b/index.php
@@ -326,4 +326,5 @@ else
        require_once(str_replace($lang . '/', '', $template));
 
 session_write_close();
+closedb();
 exit;