Skip to content

Commit

Permalink
chore: renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Nov 8, 2024
1 parent 39a2053 commit 05a074f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"private": true,
"packageManager": "yarn@4.5.0",
"workspaces": [
"crates/pdf-viewer-napi",
"packages/*",
"examples/sample",
"examples/sample-pdf-viewer",
Expand Down
2 changes: 1 addition & 1 deletion packages/pdf-viewer/__tests__/lorem-ipsum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ test('pdf lorem ipsum', async () => {
doc.close();
expect(doc.pointer).toBe(0);

viewer.dispose();
viewer.close();
});
2 changes: 1 addition & 1 deletion packages/pdf-viewer/__tests__/minimal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ test('pdf minimal', async () => {
doc.close();
expect(doc.pointer).toBe(0);

viewer.dispose();
viewer.close();
});
2 changes: 1 addition & 1 deletion packages/pdf-viewer/src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class Document {
*/
close() {
if (!this.ptr) return;
this.runtime.closeDocument(this.ptr);
this.runtime.free(this.dataPtr);
this.runtime.closeDocument(this.ptr);
this.runtime.free(this.ptr);
this.dataPtr = 0;
this.ptr = 0;
Expand Down
4 changes: 2 additions & 2 deletions packages/pdf-viewer/src/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ export class Viewer {
return new Bitmap(this.runtime, ptr, format);
}

dispose() {
close() {
this.runtime.deinit();
}

[Symbol.dispose]() {
this.dispose();
this.close();
}
}

0 comments on commit 05a074f

Please sign in to comment.