Skip to content

Commit 1d8b3b2

Browse files
authored
Merge pull request #102 from rhashimoto/bug-ahp-dissociation
Fix bug in AccessHandlePoolVFS path association management.
2 parents 6652a1a + cf05819 commit 1d8b3b2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/examples/AccessHandlePoolVFS.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ export class AccessHandlePoolVFS extends VFS.Base {
368368
// This OPFS file doesn't represent any SQLite file so it doesn't
369369
// need to keep any data.
370370
accessHandle.truncate(HEADER_OFFSET_DATA);
371-
372-
this.#mapPathToAccessHandle.delete(path);
373371
this.#availableAccessHandles.add(accessHandle);
374372
}
375373
}
@@ -420,6 +418,7 @@ export class AccessHandlePoolVFS extends VFS.Base {
420418
const accessHandle = this.#mapPathToAccessHandle.get(path);
421419
if (accessHandle) {
422420
// Un-associate the SQLite path from the OPFS file.
421+
this.#mapPathToAccessHandle.delete(path);
423422
this.#setAssociatedPath(accessHandle, '', 0);
424423
}
425424
}

0 commit comments

Comments
 (0)