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.
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!
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.