Remove token data from memory when finished with it
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 4 Sep 2010 07:33:53 +0000 (01:33 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Sep 2010 20:31:15 +0000 (14:31 -0600)
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index a37ddb0..dfaa72f 100644 (file)
@@ -3794,7 +3794,6 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 /* Tokenize response. */
                 $line = implode(' ', array_slice($read, 1));
                 $binary = $literal = false;
-                $this->_temp['token'] = null;
                 $this->_temp['literal8'] = array();
 
                 do {
@@ -3836,6 +3835,7 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
                 } while (true);
 
                 $ob['token'] = $this->_temp['token']['out'];
+                $this->_temp['token'] = null;
             }
             break;
 
@@ -3945,7 +3945,7 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
      */
     protected function _tokenizeData($line)
     {
-        if (is_null($this->_temp['token'])) {
+        if (empty($this->_temp['token'])) {
             $this->_temp['token'] = array(
                 'in_quote' => false,
                 'paren' => 0,
@@ -4245,9 +4245,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
             break;
 
         case 'CAPABILITY':
-            $this->_temp['token'] = null;
             $this->_tokenizeData($data);
             $this->_parseCapability($this->_temp['token']['out']);
+            $this->_temp['token'] = null;
             break;
 
         case 'PARSE':
@@ -4268,9 +4268,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
             break;
 
         case 'PERMANENTFLAGS':
-            $this->_temp['token'] = null;
             $this->_tokenizeData($data);
             $this->_temp['mailbox']['permflags'] = array_map('strtolower', reset($this->_temp['token']['out']));
+            $this->_temp['token'] = null;
             break;
 
         case 'UIDNEXT':