Bläddra i källkod

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

Daniele Alessandri 15 år sedan
förälder
incheckning
d6bea4390e
1 ändrade filer med 1 tillägg och 4 borttagningar
  1. 1 4
      lib/Predis.php

+ 1 - 4
lib/Predis.php

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