1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Merge pull request #3810 from peppy/fix-chat-crash

Fix hard crash due to out-of-order chat sequencing
This commit is contained in:
Dean Herbert 2018-12-03 19:27:26 +09:00 committed by GitHub
commit 2bc3c4cc8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View File

@ -98,8 +98,11 @@ namespace osu.Game.Tests.Visual
[SetUp]
public virtual void SetUp()
{
manager?.Delete(manager.GetAllUsableBeatmapSets());
Child = songSelect = new TestSongSelect();
Schedule(() =>
{
manager?.Delete(manager.GetAllUsableBeatmapSets());
Child = songSelect = new TestSongSelect();
});
}
[Test]

View File

@ -48,10 +48,6 @@ namespace osu.Game.Overlays.Chat
},
}
};
Channel.NewMessagesArrived += newMessagesArrived;
Channel.MessageRemoved += messageRemoved;
Channel.PendingMessageResolved += pendingMessageResolved;
}
protected override void LoadComplete()
@ -59,6 +55,11 @@ namespace osu.Game.Overlays.Chat
base.LoadComplete();
newMessagesArrived(Channel.Messages);
Channel.NewMessagesArrived += newMessagesArrived;
Channel.MessageRemoved += messageRemoved;
Channel.PendingMessageResolved += pendingMessageResolved;
scrollToEnd();
}
@ -78,8 +79,6 @@ namespace osu.Game.Overlays.Chat
flow.AddRange(displayMessages.Select(m => new ChatLine(m)));
if (!IsLoaded) return;
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m is LocalMessage))
scrollToEnd();

View File

@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.4" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="ppy.osu.Framework" Version="2018.1120.0" />
<PackageReference Include="ppy.osu.Framework" Version="2018.1203.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />