瀏覽代碼

Perform (p)unsubscribtion only if (p)subscribed to a channel when the destructor for Predis\PubSubContext is invoked.

Daniele Alessandri 14 年之前
父節點
當前提交
f67082072d
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      lib/Predis.php

+ 1 - 4
lib/Predis.php

@@ -951,10 +951,7 @@ class PubSubContext implements \Iterator {
     }
 
     public function __destruct() {
-        if ($this->valid()) {
-            $this->_redisClient->unsubscribe();
-            $this->_redisClient->punsubscribe();
-        }
+        $this->closeContext();
     }
 
     private function checkCapabilities(Client $redisClient) {