1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 10:22:56 +08:00

Fix potential assert failure due to Room access from disconnection event

This commit is contained in:
Dean Herbert 2022-04-08 17:41:03 +09:00
parent 975bb8cc2a
commit 6bb8243212

View File

@ -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();