mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 17:59:17 +00:00
Fix #92: Make sure the handle is closed
This commit is contained in:
@@ -20,8 +20,6 @@ using System.Windows;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using QuickLook.ExtensionMethods;
|
|
||||||
using QuickLook.Helpers;
|
|
||||||
|
|
||||||
namespace QuickLook.Plugin.ImageViewer.AnimatedImage
|
namespace QuickLook.Plugin.ImageViewer.AnimatedImage
|
||||||
{
|
{
|
||||||
@@ -31,7 +29,7 @@ namespace QuickLook.Plugin.ImageViewer.AnimatedImage
|
|||||||
{
|
{
|
||||||
var decoder =
|
var decoder =
|
||||||
new GifBitmapDecoder(new Uri(path), BitmapCreateOptions.PreservePixelFormat,
|
new GifBitmapDecoder(new Uri(path), BitmapCreateOptions.PreservePixelFormat,
|
||||||
BitmapCacheOption.Default);
|
BitmapCacheOption.OnLoad);
|
||||||
|
|
||||||
var clock = TimeSpan.Zero;
|
var clock = TimeSpan.Zero;
|
||||||
BitmapSource prevFrame = null;
|
BitmapSource prevFrame = null;
|
||||||
|
@@ -85,9 +85,12 @@ namespace QuickLook.Plugin.TextViewer
|
|||||||
s.Read(buffer, 0, bufferLength);
|
s.Read(buffer, 0, bufferLength);
|
||||||
|
|
||||||
viewer.Encoding = CharsetDetector.DetectFromBytes(buffer).Detected?.Encoding ?? Encoding.Default;
|
viewer.Encoding = CharsetDetector.DetectFromBytes(buffer).Detected?.Encoding ?? Encoding.Default;
|
||||||
|
|
||||||
|
s.Position = 0;
|
||||||
|
viewer.Load(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
viewer.Load(path);
|
//viewer.Load(path);
|
||||||
viewer.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(path));
|
viewer.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user