Avoid AppxManifest.xml leak

release Com stream Object immediately

Co-Authored-By: Andrey Nekrasov <1828123+yuyoyuppe@users.noreply.github.com>
This commit is contained in:
弘韬 张 2021-05-24 12:34:59 +08:00
parent d813a4732d
commit 39b750e821

View file

@ -17,6 +17,7 @@ using Flow.Launcher.Infrastructure;
using Flow.Launcher.Plugin.Program.Logger;
using Rect = System.Windows.Rect;
using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.Infrastructure.Logger;
namespace Flow.Launcher.Plugin.Program.Programs
{
@ -81,6 +82,11 @@ namespace Flow.Launcher.Plugin.Program.Programs
Apps = new List<Application>().ToArray();
}
if (Marshal.ReleaseComObject(stream) > 0)
{
Log.Error("Flow.Launcher.Plugin.Program.Programs.UWP", "AppxManifest.xml was leaked");
}
}