From 63942d5200d5cf2103a9ae3114d581bfd607dc47 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 10 Jan 2020 11:12:52 +0000 Subject: [PATCH] Fix listener leak on RoomView It looks like this was causing entire detached DOM trees to leak in memory by react's internal fibers holding onto them from the component. --- src/components/structures/RoomView.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index c552e2f8f5..a717f485f0 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -485,6 +485,7 @@ module.exports = createReactClass({ MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline); MatrixClientPeg.get().removeListener("Room.name", this.onRoomName); MatrixClientPeg.get().removeListener("Room.accountData", this.onRoomAccountData); + MatrixClientPeg.get().removeListener("RoomState.events", this.onRoomStateEvents); MatrixClientPeg.get().removeListener("Room.myMembership", this.onMyMembership); MatrixClientPeg.get().removeListener("RoomState.members", this.onRoomStateMember); MatrixClientPeg.get().removeListener("accountData", this.onAccountData);