mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
[PTRun]Release default image files after loading (#21327)
This commit is contained in:
@@ -50,7 +50,12 @@ namespace Wox.Infrastructure.Image
|
|||||||
|
|
||||||
foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon, Constant.LightThemedDefaultIcon, Constant.LightThemedErrorIcon })
|
foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon, Constant.LightThemedDefaultIcon, Constant.LightThemedErrorIcon })
|
||||||
{
|
{
|
||||||
ImageSource img = new BitmapImage(new Uri(icon));
|
BitmapImage bmi = new BitmapImage();
|
||||||
|
bmi.BeginInit();
|
||||||
|
bmi.UriSource = new Uri(icon);
|
||||||
|
bmi.CacheOption = BitmapCacheOption.OnLoad;
|
||||||
|
bmi.EndInit();
|
||||||
|
ImageSource img = bmi;
|
||||||
img.Freeze();
|
img.Freeze();
|
||||||
ImageCache[icon] = img;
|
ImageCache[icon] = img;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user