mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 17:59:17 +00:00
..
This commit is contained in:
@@ -15,9 +15,16 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
IconManager.ClearCache();
|
||||
}
|
||||
|
||||
~ArchiveFileListView()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public void SetDataContext(object context)
|
||||
{
|
||||
treeGrid.DataContext = context;
|
||||
|
@@ -28,9 +28,16 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
fileListView.Dispose();
|
||||
}
|
||||
|
||||
~ArchiveInfoPanel()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
private void LoadArchive(string path)
|
||||
{
|
||||
LoadItemsFromArchive(path);
|
||||
|
@@ -16,10 +16,9 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
if (Directory.Exists(path))
|
||||
return false;
|
||||
|
||||
SevenZipExtractor archive = null;
|
||||
try
|
||||
{
|
||||
using (archive = new SevenZipExtractor(path))
|
||||
using (var archive = new SevenZipExtractor(path))
|
||||
{
|
||||
// dummy access to the data. If it throws exception, return false
|
||||
if (archive.ArchiveFileData == null)
|
||||
@@ -42,10 +41,6 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
{
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
archive?.Dispose();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -63,9 +58,16 @@ namespace QuickLook.Plugin.ArchiveViewer
|
||||
container.Title = $"{Path.GetFileName(path)}";
|
||||
}
|
||||
|
||||
public void Close()
|
||||
public void Dispose()
|
||||
{
|
||||
_panel.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
_panel?.Dispose();
|
||||
}
|
||||
|
||||
~Plugin()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
@@ -36,6 +36,7 @@
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="SevenZipSharp">
|
||||
<HintPath>References\SevenZipSharp.dll</HintPath>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
Reference in New Issue
Block a user