Преглед на файлове

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