This commit is contained in:
cdwcgt 2023-02-19 02:17:24 +09:00
parent 2a6ea99e6a
commit 8446e7d841
2 changed files with 4 additions and 2 deletions

View File

@ -74,7 +74,7 @@ namespace osu.Game.Database
}
catch (ObjectDisposedException)
{
// outputStream may close before writing when request cancel
// outputStream may close before writing when request cancel.
if (cancellationToken.IsCancellationRequested)
return;

View File

@ -35,7 +35,7 @@ namespace osu.Game.Database
public Action<Notification>? PostNotification { get; set; }
// Store the model being exported.
// Store the model being exporting.
private readonly List<TModel> exportingModels = new List<TModel>();
/// <summary>
@ -62,6 +62,7 @@ namespace osu.Game.Database
/// <returns></returns>
public async Task ExportAsync(TModel model, CancellationToken? cancellationToken = null)
{
// check if the model is being exporting already
if (!exportingModels.Contains(model))
{
exportingModels.Add(model);
@ -105,6 +106,7 @@ namespace osu.Game.Database
}
finally
{
// cleanup if export is failed or canceled.
if (!success)
{
exportStorage.Delete(filename);