diff --git a/Server/App/ClankApp.php b/Server/App/ClankApp.php index c213a10..fb08ecd 100644 --- a/Server/App/ClankApp.php +++ b/Server/App/ClankApp.php @@ -46,6 +46,10 @@ public function onOpen(Conn $conn) { public function onClose(Conn $conn) { $event = new ClientEvent($conn, ClientEvent::$disconnected); $this->eventDispatcher->dispatch("clank.client.disconnected", $event); + foreach ($conn->WAMP->subscriptions as $subscription) { + $this->onUnSubscribe($conn, $subscription); + $subscription->remove($conn); + } } public function onError(Conn $conn, \Exception $e) { @@ -55,4 +59,4 @@ public function onError(Conn $conn, \Exception $e) { $this->eventDispatcher->dispatch("clank.client.error", $event); } -} \ No newline at end of file +}