aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Common/RateLimiter.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-11-07 23:16:26 -0600
committerGitHub <noreply@github.com>2026-11-07 23:16:26 -0600
commitcefdcd02e28b1f02f546002fdd475de4fa03e839 (patch)
tree95bb26f4ed7b60e3739bcd884966a19be1e9ee07 /src/slskd/Common/RateLimiter.cs
parent2b827344d11e7490b323defa898264cadbdb6089 (diff)
parentdbc308d5e408a2e194a0c70a8fc7592f776aaf11 (diff)
downloadslskd-cefdcd02e28b1f02f546002fdd475de4fa03e839.tar.gz
Merge pull request #1913 from slskd/bugs
Fix a random assortment of bugs
Diffstat (limited to 'src/slskd/Common/RateLimiter.cs')
-rw-r--r--src/slskd/Common/RateLimiter.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/slskd/Common/RateLimiter.cs b/src/slskd/Common/RateLimiter.cs
index ac34ed5d..7229441f 100644
--- a/src/slskd/Common/RateLimiter.cs
+++ b/src/slskd/Common/RateLimiter.cs
@@ -97,6 +97,7 @@ namespace slskd
return;
}
+ // previously staged action is lost, intentionally
Staged = action;
}
@@ -131,8 +132,11 @@ namespace slskd
{
try
{
- Staged?.Invoke();
+ // capture the staged action before nulling it to avoid
+ // a race where another action might slip in between the invoke and null
+ var staged = Staged;
Staged = null;
+ staged?.Invoke();
}
finally
{