diff options
Diffstat (limited to 'ext/net/01_net.js')
-rw-r--r-- | ext/net/01_net.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/net/01_net.js b/ext/net/01_net.js index f2bf5e7df..05aca07e5 100644 --- a/ext/net/01_net.js +++ b/ext/net/01_net.js @@ -9,6 +9,8 @@ import { writableStreamForRid, } from "ext:deno_web/06_streams.js"; import * as abortSignal from "ext:deno_web/03_abort_signal.js"; +import { SymbolDispose } from "ext:deno_web/00_infra.js"; + const primordials = globalThis.__bootstrap.primordials; const { ArrayPrototypeFilter, @@ -160,6 +162,10 @@ class Conn { (id) => core.unrefOp(id), ); } + + [SymbolDispose]() { + core.tryClose(this.#rid); + } } class TcpConn extends Conn { @@ -249,6 +255,10 @@ class Listener { core.close(this.rid); } + [SymbolDispose]() { + core.tryClose(this.#rid); + } + [SymbolAsyncIterator]() { return this; } |