This commit is contained in:
freek 2018-11-27 21:42:17 +01:00
parent 525d0357b9
commit 059c521270
1 changed files with 6 additions and 0 deletions

View File

@ -51,8 +51,14 @@ class ChannelManager
return;
}
/**
* Remove the connection from all channels.
*/
collect($this->channels[$connection->client->appId])->each->unsubscribe($connection);
/**
* Unset all channels that have no connections so we don't leak memory.
*/
collect($this->channels[$connection->client->appId])
->reject->hasConnections()
->each(function (Channel $channel, string $channelId) use ($connection) {