MuPDFCore icon indicating copy to clipboard operation
MuPDFCore copied to clipboard

Sometimes System.AccessViolationException is thrown when MuPDFRenderer is disposing

Open lexboss777 opened this issue 7 months ago • 4 comments

Hi! Recently I started looking at this library and it seems very useful. But very often I receive an exception mentioned above. It occurs when I close the window with MuPDFRenderer. I see that renderer has callback ControlDetachedFromLogicalTree and invokes disposing methods in there.

>	MuPDFCore.dll!MuPDFCore.MuPDFContext.Dispose(bool disposing) Line 182	C#
 	MuPDFCore.dll!MuPDFCore.MuPDFContext.Dispose() Line 196	C#
 	MuPDFCore.dll!MuPDFCore.MuPDFMultiThreadedPageRenderer.Dispose(bool disposing) Line 583	C#
 	MuPDFCore.dll!MuPDFCore.MuPDFMultiThreadedPageRenderer.Dispose() Line 594	C#
 	MuPDFCore.MuPDFRenderer.dll!MuPDFCore.MuPDFRenderer.PDFRenderer.ReleaseResources() Line 625	C#
 	MuPDFCore.MuPDFRenderer.dll!MuPDFCore.MuPDFRenderer.PDFRenderer.ControlDetachedFromLogicalTree(object sender, Avalonia.LogicalTree.LogicalTreeAttachmentEventArgs e) Line 645	C#

I've seen that the previous issue is also about that but it's already closed and it seems the discussion were focused in disposing order when invoked manually, but I am not invoking any disposing methods on my own, it's done by MuPDFRenderer itself.

lexboss777 avatar Jul 03 '24 09:07 lexboss777