Skip to content

Commit

Permalink
Merge pull request #102 from rhashimoto/bug-ahp-dissociation
Browse files Browse the repository at this point in the history
Fix bug in AccessHandlePoolVFS path association management.
  • Loading branch information
rhashimoto authored Jul 17, 2023
2 parents 6652a1a + cf05819 commit 1d8b3b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/examples/AccessHandlePoolVFS.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@ export class AccessHandlePoolVFS extends VFS.Base {
// This OPFS file doesn't represent any SQLite file so it doesn't
// need to keep any data.
accessHandle.truncate(HEADER_OFFSET_DATA);

this.#mapPathToAccessHandle.delete(path);
this.#availableAccessHandles.add(accessHandle);
}
}
Expand Down Expand Up @@ -420,6 +418,7 @@ export class AccessHandlePoolVFS extends VFS.Base {
const accessHandle = this.#mapPathToAccessHandle.get(path);
if (accessHandle) {
// Un-associate the SQLite path from the OPFS file.
this.#mapPathToAccessHandle.delete(path);
this.#setAssociatedPath(accessHandle, '', 0);
}
}
Expand Down

0 comments on commit 1d8b3b2

Please sign in to comment.