mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09: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:
@ -50,11 +50,10 @@ namespace osu.Game.Database
|
|||||||
/// <param name="item">The item to update.</param>
|
/// <param name="item">The item to update.</param>
|
||||||
public void Update(T item)
|
public void Update(T item)
|
||||||
{
|
{
|
||||||
ItemRemoved?.Invoke(item);
|
|
||||||
|
|
||||||
using (var usage = ContextFactory.GetForWrite())
|
using (var usage = ContextFactory.GetForWrite())
|
||||||
usage.Context.Update(item);
|
usage.Context.Update(item);
|
||||||
|
|
||||||
|
ItemRemoved?.Invoke(item);
|
||||||
ItemAdded?.Invoke(item);
|
ItemAdded?.Invoke(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user