mirror of
https://github.com/ppy/osu
synced 2025-02-18 19:36:58 +00:00
Fix multiple notifications arriving for imports in edge cases
This commit is contained in:
parent
4dabb1aa9c
commit
e761c0395d
@ -148,7 +148,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
}
|
||||
}
|
||||
|
||||
private bool completionSent;
|
||||
private int completionSent;
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to post a completion notification.
|
||||
@ -162,11 +162,11 @@ namespace osu.Game.Overlays.Notifications
|
||||
if (CompletionTarget == null)
|
||||
return;
|
||||
|
||||
if (completionSent)
|
||||
// Thread-safe barrier, as this may be called by a web request and also scheduled to the update thread at the same time.
|
||||
if (Interlocked.Increment(ref completionSent) == 0)
|
||||
return;
|
||||
|
||||
CompletionTarget.Invoke(CreateCompletionNotification());
|
||||
completionSent = true;
|
||||
|
||||
Close(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user