1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Change order of event firing in Update calls

A remove event should not be fired before the update is successful.
This commit is contained in:
Dean Herbert 2018-05-29 11:37:47 +09:00
parent 80806be047
commit 72da640059

View File

@ -50,11 +50,10 @@ namespace osu.Game.Database
/// <param name="item">The item to update.</param>
public void Update(T item)
{
ItemRemoved?.Invoke(item);
using (var usage = ContextFactory.GetForWrite())
usage.Context.Update(item);
ItemRemoved?.Invoke(item);
ItemAdded?.Invoke(item);
}