소스 검색

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) {