File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Plugins/Flow.Launcher.Plugin.Program Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
367
367
Title = Context . API . GetTranslation ( "flowlauncher_plugin_program_disable_program" ) ,
368
368
Action = c =>
369
369
{
370
- DisableProgram ( program ) ;
370
+ _ = DisableProgramAsync ( program ) ;
371
371
Context . API . ShowMsg (
372
372
Context . API . GetTranslation ( "flowlauncher_plugin_program_disable_dlgtitle_success" ) ,
373
373
Context . API . GetTranslation (
@@ -383,7 +383,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
383
383
return menuOptions ;
384
384
}
385
385
386
- private static async Task DisableProgram ( IProgram programToDelete )
386
+ private static async Task DisableProgramAsync ( IProgram programToDelete )
387
387
{
388
388
if ( _settings . DisabledProgramSources . Any ( x => x . UniqueIdentifier == programToDelete . UniqueIdentifier ) )
389
389
return ;
@@ -403,7 +403,12 @@ private static async Task DisableProgram(IProgram programToDelete)
403
403
} ) ;
404
404
return ;
405
405
}
406
-
406
+ else
407
+ {
408
+ // Release the lock if we cannot find the program
409
+ _uwpsLock . Release ( ) ;
410
+ }
411
+
407
412
await _win32sLock . WaitAsync ( ) ;
408
413
if ( _win32s . Any ( x => x . UniqueIdentifier == programToDelete . UniqueIdentifier ) )
409
414
{
@@ -418,6 +423,11 @@ private static async Task DisableProgram(IProgram programToDelete)
418
423
_ = IndexWin32ProgramsAsync ( ) ;
419
424
} ) ;
420
425
}
426
+ else
427
+ {
428
+ // Release the lock if we cannot find the program
429
+ _win32sLock . Release ( ) ;
430
+ }
421
431
}
422
432
423
433
public static void StartProcess ( Func < ProcessStartInfo , Process > runProcess , ProcessStartInfo info )
You can’t perform that action at this time.
0 commit comments