diff options
Diffstat (limited to 'ext/kv')
-rw-r--r-- | ext/kv/01_db.ts | 5 | ||||
-rw-r--r-- | ext/kv/lib.rs | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/ext/kv/01_db.ts b/ext/kv/01_db.ts index 6e8a571f0..34678261a 100644 --- a/ext/kv/01_db.ts +++ b/ext/kv/01_db.ts @@ -12,6 +12,7 @@ const { SymbolToStringTag, Uint8ArrayPrototype, } = globalThis.__bootstrap.primordials; +import { SymbolDispose } from "ext:deno_web/00_infra.js"; const core = Deno.core; const ops = core.ops; @@ -299,6 +300,10 @@ class Kv { close() { core.close(this.#rid); } + + [SymbolDispose]() { + core.tryClose(this.#rid); + } } class AtomicOperation { diff --git a/ext/kv/lib.rs b/ext/kv/lib.rs index 9e2273108..d357a2927 100644 --- a/ext/kv/lib.rs +++ b/ext/kv/lib.rs @@ -66,7 +66,7 @@ const MAX_TOTAL_MUTATION_SIZE_BYTES: usize = 800 * 1024; const MAX_TOTAL_KEY_SIZE_BYTES: usize = 80 * 1024; deno_core::extension!(deno_kv, - deps = [ deno_console ], + deps = [ deno_console, deno_web ], parameters = [ DBH: DatabaseHandler ], ops = [ op_kv_database_open<DBH>, |