Performance: fix memory leak when destroying chatrooms (#2821)

The log writing stream was never closed when chatrooms were deleted.
This commit is contained in:
Ben Davies 2016-10-05 06:18:47 -03:00 committed by Guangcong Luo
parent 2de233e338
commit 71400a22be

View File

@ -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);
}