mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-10 17:29:08 +00:00
..
This commit is contained in:
@@ -23,11 +23,18 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
LibMuPdf.NativeMethods.CloseDocument(_doc);
|
||||
LibMuPdf.NativeMethods.CloseStream(_stm);
|
||||
LibMuPdf.NativeMethods.FreeContext(_ctx);
|
||||
}
|
||||
|
||||
~PdfFile()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public bool IsLastPage(int pageId)
|
||||
{
|
||||
return pageId >= TotalPages;
|
||||
|
@@ -55,13 +55,20 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_whellMonitor.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
_whellMonitor?.Dispose();
|
||||
PdfHandleForThumbnails?.Dispose();
|
||||
PdfHandle?.Dispose();
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
~PdfViewerControl()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public event EventHandler CurrentPageChanged;
|
||||
|
||||
private void NavigatePage(object sender, MouseWheelEventArgs e)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace QuickLook.Plugin.PDFViewer
|
||||
@@ -45,10 +46,17 @@ namespace QuickLook.Plugin.PDFViewer
|
||||
};
|
||||
}
|
||||
|
||||
public void Close()
|
||||
public void Dispose()
|
||||
{
|
||||
_pdfControl.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
_pdfControl?.Dispose();
|
||||
_pdfControl = null;
|
||||
}
|
||||
|
||||
~Plugin()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user