mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Reset task post-execution
This commit is contained in:
parent
e005a1cc9f
commit
6b139d4cf3
@ -155,7 +155,19 @@ namespace osu.Game.Online.Multiplayer
|
||||
});
|
||||
}
|
||||
|
||||
await newTask;
|
||||
try
|
||||
{
|
||||
await newTask;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// The task will be awaited in the future, so reset it so that the user doesn't get into a permanently faulted state if anything fails.
|
||||
lock (joinOrLeaveTask)
|
||||
{
|
||||
if (joinOrLeaveTask == newTask)
|
||||
joinOrLeaveTask = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -193,7 +205,19 @@ namespace osu.Game.Online.Multiplayer
|
||||
});
|
||||
}
|
||||
|
||||
await newTask;
|
||||
try
|
||||
{
|
||||
await newTask;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// The task will be awaited in the future, so reset it so that the user doesn't get into a permanently faulted state if anything fails.
|
||||
lock (joinOrLeaveTask)
|
||||
{
|
||||
if (joinOrLeaveTask == newTask)
|
||||
joinOrLeaveTask = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user