Skip to content

Commit 2390b53

Browse files
Copilotd2dyno1
andauthored
Fix potential deadlock in RedirectActivationTo by using try/finally
Agent-Logs-Url: https://github.com/securefolderfs-community/SecureFolderFS/sessions/90164be5-d7ca-4676-8ea7-7262be4f28f0 Co-authored-by: d2dyno1 <53011783+d2dyno1@users.noreply.github.com>
1 parent 29d6c5d commit 2390b53

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/Platforms/SecureFolderFS.Uno/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ private static void RedirectActivationTo(AppInstance targetInstance, AppActivati
5959
var redirectSemaphore = new SemaphoreSlim(0, 1);
6060
Task.Run(async () =>
6161
{
62-
await targetInstance.RedirectActivationToAsync(args);
63-
redirectSemaphore.Release();
62+
try
63+
{
64+
await targetInstance.RedirectActivationToAsync(args);
65+
}
66+
finally
67+
{
68+
redirectSemaphore.Release();
69+
}
6470
});
6571
redirectSemaphore.Wait();
6672
}

0 commit comments

Comments
 (0)