fix(core): even more graceful close
This commit is contained in:
parent
bbb8d4b908
commit
81f8ea9fd2
2 changed files with 2 additions and 1 deletions
|
@ -308,7 +308,7 @@ export class MtClient extends EventEmitter {
|
||||||
emitError(err: unknown): void {
|
emitError(err: unknown): void {
|
||||||
if (this._emitError) {
|
if (this._emitError) {
|
||||||
this._emitError(err)
|
this._emitError(err)
|
||||||
} else {
|
} else if (this._connect.finished()) {
|
||||||
this.log.error('unhandled error:', err)
|
this.log.error('unhandled error:', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -879,6 +879,7 @@ export class NetworkManager {
|
||||||
for (const dc of this._dcConnections.values()) {
|
for (const dc of this._dcConnections.values()) {
|
||||||
await dc.destroy()
|
await dc.destroy()
|
||||||
}
|
}
|
||||||
|
this._dcConnections.clear()
|
||||||
this.config.offReload(this._onConfigChanged)
|
this.config.offReload(this._onConfigChanged)
|
||||||
this._resetOnNetworkChange?.()
|
this._resetOnNetworkChange?.()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue