mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix lock release issue
This commit is contained in:
parent
87aca2ffef
commit
734c5bb67d
1 changed files with 13 additions and 3 deletions
|
|
@ -367,7 +367,7 @@ namespace Flow.Launcher.Plugin.Program
|
||||||
Title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_program"),
|
Title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_program"),
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
DisableProgram(program);
|
_ = DisableProgramAsync(program);
|
||||||
Context.API.ShowMsg(
|
Context.API.ShowMsg(
|
||||||
Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
|
Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
|
||||||
Context.API.GetTranslation(
|
Context.API.GetTranslation(
|
||||||
|
|
@ -383,7 +383,7 @@ namespace Flow.Launcher.Plugin.Program
|
||||||
return menuOptions;
|
return menuOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task DisableProgram(IProgram programToDelete)
|
private static async Task DisableProgramAsync(IProgram programToDelete)
|
||||||
{
|
{
|
||||||
if (_settings.DisabledProgramSources.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
if (_settings.DisabledProgramSources.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
||||||
return;
|
return;
|
||||||
|
|
@ -403,7 +403,12 @@ namespace Flow.Launcher.Plugin.Program
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Release the lock if we cannot find the program
|
||||||
|
_uwpsLock.Release();
|
||||||
|
}
|
||||||
|
|
||||||
await _win32sLock.WaitAsync();
|
await _win32sLock.WaitAsync();
|
||||||
if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
||||||
{
|
{
|
||||||
|
|
@ -418,6 +423,11 @@ namespace Flow.Launcher.Plugin.Program
|
||||||
_ = IndexWin32ProgramsAsync();
|
_ = IndexWin32ProgramsAsync();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Release the lock if we cannot find the program
|
||||||
|
_win32sLock.Release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void StartProcess(Func<ProcessStartInfo, Process> runProcess, ProcessStartInfo info)
|
public static void StartProcess(Func<ProcessStartInfo, Process> runProcess, ProcessStartInfo info)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue