[PTRun]Release default image files after loading (#21327)
This commit is contained in:
Родитель
d73fae4f95
Коммит
778bb7ad9f
|
@ -50,7 +50,12 @@ namespace Wox.Infrastructure.Image
|
|||
|
||||
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();
|
||||
ImageCache[icon] = img;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче