diff --git a/src/Application/ServerApplication.php b/src/Application/ServerApplication.php index cb5043f..e5b2fbf 100644 --- a/src/Application/ServerApplication.php +++ b/src/Application/ServerApplication.php @@ -107,10 +107,15 @@ public function addClient(Protocol\LivereloadProtocol $client) public function removeClient(Protocol\LivereloadProtocol $client) { + $this->clients = array_values(array_filter($this->clients, function($client) { + return !empty($client->app) && !empty($client->conn); + })); + $index = array_search($client, $this->clients, true); if($index == false){ return; } + unset($this->clients[$index]); }