izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
106 stars 30 forks source link

Clean up workers after PDF closed #226

Closed Aerijo closed 4 years ago

Aerijo commented 4 years ago

This calls the destroy method on the PDF document when the view is closed. Without this call, workers persist in memory, and accumulate with each PDF opened or refresh (e.g., for LaTeX).

This will help with #225, but may not clean up all workers. When compiling LaTeX, it apparently makes intermediate PDFs with invalid contents. With auto reload enabled, this package will try to display these bad PDFs and PDF.js will throw an error somewhere, but the worker created for that failed PDF persists.

izuzak commented 4 years ago

Thanks so much for this, @Aerijo 🍰 Gotta admit that I'm not very familiar with PDFjs and I never had the time to investigate the performance problems, so I'm happy to give this a try!