mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 13:33:03 +08:00
Fix event flushing sticking on early return
This commit is contained in:
parent
4a18951cce
commit
31ab6f2408
@ -174,7 +174,7 @@ namespace osu.Game.Database
|
|||||||
/// <param name="archive">The archive to be imported.</param>
|
/// <param name="archive">The archive to be imported.</param>
|
||||||
public TModel Import(ArchiveReader archive)
|
public TModel Import(ArchiveReader archive)
|
||||||
{
|
{
|
||||||
TModel item;
|
TModel item = null;
|
||||||
delayEvents();
|
delayEvents();
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -211,9 +211,12 @@ namespace osu.Game.Database
|
|||||||
Logger.Error(e, $"Import of {archive.Name} failed and has been rolled back.", LoggingTarget.Database);
|
Logger.Error(e, $"Import of {archive.Name} failed and has been rolled back.", LoggingTarget.Database);
|
||||||
item = null;
|
item = null;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
// we only want to flush events after we've confirmed the write context didn't have any errors.
|
// we only want to flush events after we've confirmed the write context didn't have any errors.
|
||||||
flushEvents(item != null);
|
flushEvents(item != null);
|
||||||
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user