Remove _beforeUnloadHandler after destroy
This commit is contained in:
parent
c6a88a130b
commit
017b9e8b8f
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue