Skip to content

Commit dbef886

Browse files
wjlafranceclaude
andcommitted
Fix Channel.Designate race condition on DesignatedHeirs
Designate() wrote to the dictionary without a lock while RemoveUser() locked it, creating a data race. Add matching lock. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 35a349b commit dbef886

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Atlasd/Battlenet/Channel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,10 @@ public void Close()
285285

286286
public void Designate(GameState designator, GameState heir)
287287
{
288-
DesignatedHeirs[designator] = heir;
288+
lock (DesignatedHeirs)
289+
{
290+
DesignatedHeirs[designator] = heir;
291+
}
289292
}
290293

291294
public bool DisbandInto(Channel destination)

0 commit comments

Comments
 (0)