mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 01:22:59 +08:00
catch ObjectDisposedException
This commit is contained in:
parent
d611603742
commit
30985f192e
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@ -39,6 +40,8 @@ namespace osu.Game.Database
|
|||||||
float i = 0;
|
float i = 0;
|
||||||
bool fileMissing = false;
|
bool fileMissing = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
foreach (var file in model.Files)
|
foreach (var file in model.Files)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
@ -69,5 +72,14 @@ namespace osu.Game.Database
|
|||||||
notification.Text = $"Exporting... ({i}/{model.Files.Count()})";
|
notification.Text = $"Exporting... ({i}/{model.Files.Count()})";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (ObjectDisposedException)
|
||||||
|
{
|
||||||
|
// outputStream may close before writing when request cancel
|
||||||
|
if (cancellationToken.IsCancellationRequested)
|
||||||
|
return;
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user