reconnect: disconnect on destroy.

This commit is contained in:
Miroslav Šedivý
2021-07-26 23:35:19 +02:00
parent 28f256b5b5
commit b8453b3211
3 changed files with 4 additions and 5 deletions

View File

@ -173,10 +173,7 @@ export class Reconnector extends EventEmitter<ReconnectorEvents> {
}
public destroy() {
if (this._timeout) {
window.clearTimeout(this._timeout)
this._timeout = undefined
}
this.close()
this._conn.off('connect', this._onConnectHandle)
this._conn.off('disconnect', this._onDisconnectHandle)