diff --git a/src/Kdyby/Events/EventManager.php b/src/Kdyby/Events/EventManager.php index d226a72..32c51cf 100644 --- a/src/Kdyby/Events/EventManager.php +++ b/src/Kdyby/Events/EventManager.php @@ -231,10 +231,10 @@ public function removeEventListener($unsubscribe, $subscriber = NULL) } if (empty($this->listeners[$eventName])) { unset($this->listeners[$eventName]); - } - // there are no listeners for this specific event, so no reason to call sort on next dispatch - $this->sorted[$eventName] = array(); + // there are no listeners for this specific event, so no reason to call sort on next dispatch + $this->sorted[$eventName] = array(); + } } } }