Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching between multiple PDFs causes crash #103

Closed
courdek opened this issue Apr 11, 2024 · 1 comment · Fixed by #105
Closed

Switching between multiple PDFs causes crash #103

courdek opened this issue Apr 11, 2024 · 1 comment · Fixed by #105
Labels
bug Something isn't working

Comments

@courdek
Copy link

courdek commented Apr 11, 2024

When loading and switching between multiple PDFs, the browser tab will crash after n times. This can be reproduced on the documentation page by clicking "Next PDF" approximately 30 times (I imagine this will vary depending on the computer).

Inspecting the memory usage shows a new Javascript VM instance being created every time the PDF is changed. Essentially it acts like a memory leak. Eventually it overwhelms the tab and crashes.

Additional context
image
image

@TaTo30 TaTo30 added the bug Something isn't working label Apr 25, 2024
GuoyiCoding added a commit to GuoyiCoding/vue-pdf that referenced this issue May 4, 2024
@GuoyiCoding
Copy link

GuoyiCoding commented May 4, 2024

I used PDFDocumentProxy.destory() to destroy the previous document instance and terminate the worker when source of pdf has changed.

Now, it seems that every JavaScript VM instance created before can be destroyed normally.

Before
before

After
after

see #105

@TaTo30 TaTo30 linked a pull request May 5, 2024 that will close this issue
TaTo30 added a commit that referenced this issue May 5, 2024
Fix issue #103: Destroy the previous document instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants