1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +08:00

Remove performance optimisation tracking disables to keep things simple for now

This commit is contained in:
Dean Herbert 2018-05-30 13:43:43 +09:00
parent 4a7de043e0
commit eb89317494

View File

@ -240,12 +240,8 @@ namespace osu.Game.Database
/// <param name="item">The item to delete.</param> /// <param name="item">The item to delete.</param>
public void Delete(TModel item) public void Delete(TModel item)
{ {
using (var usage = ContextFactory.GetForWrite()) using (ContextFactory.GetForWrite())
{ {
var context = usage.Context;
context.ChangeTracker.AutoDetectChangesEnabled = false;
// re-fetch the model on the import context. // re-fetch the model on the import context.
var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == item.ID); var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == item.ID);
@ -253,8 +249,6 @@ namespace osu.Game.Database
if (ModelStore.Delete(foundModel)) if (ModelStore.Delete(foundModel))
Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray()); Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray());
context.ChangeTracker.AutoDetectChangesEnabled = true;
} }
} }