From 778bb7ad9f5f1149317bb1a02ee3dd869593870b Mon Sep 17 00:00:00 2001 From: Laszlo Nemeth <57342539+donlaci@users.noreply.github.com> Date: Tue, 25 Oct 2022 21:27:27 +0200 Subject: [PATCH] [PTRun]Release default image files after loading (#21327) --- .../launcher/Wox.Infrastructure/Image/ImageLoader.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/launcher/Wox.Infrastructure/Image/ImageLoader.cs b/src/modules/launcher/Wox.Infrastructure/Image/ImageLoader.cs index fab516a6c2..3cc5832c5c 100644 --- a/src/modules/launcher/Wox.Infrastructure/Image/ImageLoader.cs +++ b/src/modules/launcher/Wox.Infrastructure/Image/ImageLoader.cs @@ -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; }