mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 09:49:24 +02:00
fix(adb): close writable stream when closing AdbDaemonTransport
This commit is contained in:
parent
637d1f9bf8
commit
e185d6a7c6
3 changed files with 28 additions and 6 deletions
|
@ -305,8 +305,13 @@ export class AdbPacketDispatcher implements Closeable {
|
|||
// It's possible that we haven't received all `CLSE` confirm packets,
|
||||
// but it doesn't matter, the next connection can cope with them.
|
||||
this.#closed = true;
|
||||
|
||||
this.#readAbortController.abort();
|
||||
this.#writer.releaseLock();
|
||||
if (this.options.preserveConnection ?? false) {
|
||||
this.#writer.releaseLock();
|
||||
} else {
|
||||
await this.#writer.close();
|
||||
}
|
||||
|
||||
// `pipe().then()` will call `dispose`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue