Add await and make cancel async

This commit is contained in:
Michael Bucari-Tovo 2022-05-15 09:30:44 -06:00
parent c0ef3ccbea
commit 0ff8da2cf0
3 changed files with 8 additions and 9 deletions

View file

@ -139,15 +139,14 @@ namespace LibationWinForms.ProcessQueue
return Result;
}
public void Cancel()
public async Task Cancel()
{
try
{
if (CurrentProcessable is AudioDecodable audioDecodable)
{
//There's some threadding bug that causes this to hang if executed synchronously.
Task.Run(audioDecodable.Cancel);
await Task.Run(audioDecodable.Cancel);
}
}
catch (Exception ex)