mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-27 10:59:16 -05:00
Performance: fix memory leak when destroying chatrooms (#2821)
The log writing stream was never closed when chatrooms were deleted.
This commit is contained in:
parent
2de233e338
commit
71400a22be
6
rooms.js
6
rooms.js
|
|
@ -1636,6 +1636,12 @@ class ChatRoom extends Room {
|
|||
}
|
||||
this.logUserStatsInterval = null;
|
||||
|
||||
if (!this.isPersonal) {
|
||||
this.modlogStream.destroySoon();
|
||||
this.modlogStream.removeAllListeners('finish');
|
||||
}
|
||||
this.modlogStream = null;
|
||||
|
||||
// get rid of some possibly-circular references
|
||||
Rooms.rooms.delete(this.id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user