mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:47:29 +08:00
Merge pull request #17724 from peppy/fix-disconnect-assert-issue
Fix potential assert failure due to `Room` access from disconnection event
This commit is contained in:
commit
e6e475118f
@ -142,7 +142,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
IsConnected.BindValueChanged(connected =>
|
||||
IsConnected.BindValueChanged(connected => Scheduler.Add(() =>
|
||||
{
|
||||
// clean up local room state on server disconnect.
|
||||
if (!connected.NewValue && Room != null)
|
||||
@ -150,7 +150,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
Logger.Log("Connection to multiplayer server was lost.", LoggingTarget.Runtime, LogLevel.Important);
|
||||
LeaveRoom();
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
private readonly TaskChain joinOrLeaveTaskChain = new TaskChain();
|
||||
|
Loading…
Reference in New Issue
Block a user