jsPDF
jsPDF copied to clipboard
memory leak with global content and outputDestination
Hi, there, the source code below will occured a memory leak, I will share my sights after.
https://github.com/parallax/jsPDF/blob/5d09af9135a2fe049c7d3c8b95df280d22e4a6db/src/jspdf.js#L733-L742
pdf.output('blob')
will call buildDocument()
; after this call, the reference with conent
and outputDestination
still exists by closure. If you build a heavy-memory web app, it will cause serious memory leak problems after exporting a pdf and even collapse the page.
I am sorry for not providing a minimal reproduce demo, but you can hook the content
on the global window
and see it. I submit this issue is begging for discussion, and I would be happy to submit a pull request if Maitainer agreed with this issue.
Thanks a lot. jsPDF is an amazing library and has helped me a lot.
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.
(⊙o⊙)… no response