aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-worker1.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/wasm/api/sqlite3-api-worker1.js')
-rw-r--r--ext/wasm/api/sqlite3-api-worker1.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/wasm/api/sqlite3-api-worker1.js b/ext/wasm/api/sqlite3-api-worker1.js
index 55faab282..6c0900a50 100644
--- a/ext/wasm/api/sqlite3-api-worker1.js
+++ b/ext/wasm/api/sqlite3-api-worker1.js
@@ -365,13 +365,11 @@ sqlite3.initWorker1API = function(){
if(db){
delete this.dbs[getDbId(db)];
const filename = db.getFilename();
+ const pVfs = sqlite3.capi.wasm.sqlite3_wasm_db_vfs(db.pointer, 0);
db.close();
if(db===this.defaultDb) this.defaultDb = undefined;
- if(alsoUnlink && filename){
- /* This isn't necessarily correct: the db might be using a
- VFS other than the default. How do we best resolve this
- without having to special-case the opfs VFSes? */
- sqlite3.capi.wasm.sqlite3_wasm_vfs_unlink(filename);
+ if(alsoUnlink && filename && pVfs){
+ sqlite3.capi.wasm.sqlite3_wasm_vfs_unlink(pVfs, filename);
}
}
},