[Svn] r3967 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Wed Sep 15 15:36:17 CEST 2010


Author: alec
Date: 2010-09-15 08:36:17 -0500 (Wed, 15 Sep 2010)
New Revision: 3967

Modified:
   trunk/roundcubemail/program/include/rcmail.php
Log:
- Fix: close() method of addressbook object(s) is not called in shutdown function


Modified: trunk/roundcubemail/program/include/rcmail.php
===================================================================
--- trunk/roundcubemail/program/include/rcmail.php	2010-09-15 12:15:01 UTC (rev 3966)
+++ trunk/roundcubemail/program/include/rcmail.php	2010-09-15 13:36:17 UTC (rev 3967)
@@ -45,6 +45,7 @@
   public $comm_path = './';
 
   private $texts;
+  private $books = array();
 
 
   /**
@@ -280,6 +281,10 @@
       $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 @@
     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'])

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list