Remove _beforeUnloadHandler after destroy

This commit is contained in:
Liquidibrium 2022-04-24 10:43:16 +04:00
parent c6a88a130b
commit 017b9e8b8f

View file

@ -428,6 +428,11 @@ export class Room {
destroy () { destroy () {
this.disconnect() this.disconnect()
if (typeof window !== 'undefined') {
window.removeEventListener('beforeunload', this._beforeUnloadHandler)
} else if (typeof process !== 'undefined') {
process.off('exit', this._beforeUnloadHandler)
}
} }
} }