Browse Source

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

Daniele Alessandri 14 years ago
parent
commit
f67082072d
1 changed files with 1 additions and 4 deletions
  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) {