voice: delete receive stream immediately to prevent it being written to after end (#2678)

This commit is contained in:
Amish Shah
2018-08-07 17:34:01 +01:00
parent c10b4feeeb
commit 46fa9603c2
2 changed files with 8 additions and 2 deletions

View File

@@ -17,7 +17,10 @@ class PacketHandler extends EventEmitter {
_stoppedSpeaking(userID) {
const streamInfo = this.streams.get(userID);
if (streamInfo && streamInfo.end === 'silence') streamInfo.stream.push(null);
if (streamInfo && streamInfo.end === 'silence') {
this.streams.delete(userID);
streamInfo.stream.push(null);
}
}
makeStream(user, end) {