summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-09-15 13:36:17 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-09-15 13:36:17 +0000
commitc991b2467aed13b8e1557e4b4c7ad2034287200d (patch)
treef3de60b6dc42797b95756b7279f2e289b3e8b2ce /roundcubemail/program
parent1c3a1cf26f06580c901e283e596bf0e10ed193c7 (diff)
- Fix: close() method of addressbook object(s) is not called in shutdown function
git-svn-id: https://svn.roundcube.net/trunk@3967 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/rcmail.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php
index 0a7c15d84..e91111975 100644
--- a/roundcubemail/program/include/rcmail.php
+++ b/roundcubemail/program/include/rcmail.php
@@ -45,6 +45,7 @@ class rcmail
public $comm_path = './';
private $texts;
+ private $books = array();
/**
@@ -280,6 +281,10 @@ class rcmail
$contacts = new rcube_contacts($this->db, $this->user->ID);
}
+ // add to the 'books' array for shutdown function
+ if (!in_array($contacts, $this->books))
+ $this->books[] = $contacts;
+
return $contacts;
}
@@ -974,8 +979,9 @@ class rcmail
if (is_object($this->smtp))
$this->smtp->disconnect();
- if (is_object($this->contacts))
- $this->contacts->close();
+ foreach ($this->books as $book)
+ if (is_object($book))
+ $book->close();
// before closing the database connection, write session data
if ($_SERVER['REMOTE_ADDR'])