1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-13 23:41:50 +03:00

remove listener on unmount

This commit is contained in:
David Baker
2016-02-04 13:06:59 +00:00
parent 3c2c2b051b
commit 574560cc05

View File

@ -274,6 +274,7 @@ module.exports = React.createClass({
}
dis.unregister(this.dispatcherRef);
if (MatrixClientPeg.get()) {
MatrixClientPeg.get().removeListener("Room", this.onRoom);
MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
MatrixClientPeg.get().removeListener("Room.name", this.onRoomName);
MatrixClientPeg.get().removeListener("Room.accountData", this.onRoomAccountData);