mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 20:47:22 +08:00
Perform a reload on objects when Refreshing them
Previously, it was possible for an object to be "refreshed" with a stale cached state from the current thread's context. This ensures a check against the database is performed as well. Resolves #1562.
This commit is contained in:
parent
1824540325
commit
85827f83eb
@ -35,6 +35,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
var id = obj.ID;
|
var id = obj.ID;
|
||||||
obj = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find<T>(id);
|
obj = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find<T>(id);
|
||||||
|
context.Entry(obj).Reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user