Closed SHADOW202021 closed 5 months ago
Hi @SHADOW202021,
I agree that the PDF renderer does keep a handle around for a bit. It also keeps a number of D2D resources. I think it does this to speed multi-page renders (think of the standard use in a PDF viewer). After some unspecified delay, the renderer does clean these up. I don't notice any leaks when looping through thousands of files.
I've not noticed any ill effect from the handle staying open for a bit. The file handle is opened as FILE_SHARE_DELETE | FILE_SHARE_READ
, so unless you are opening the file for subsequent writes it should not cause a problem.
Can you clarify what issue you are running into?
Closing for now. Feel free to reopen.
Hi. You may want to use the LoadFromStreamAsync method of Windows.Data.Pdf.PdfDocument, as it seems to have an issue where it doesn't always immediately release the file resource once it is done.