1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

catch when zipWriter dispose

ObjectDisposedException also appear when zipwriter dispose after user request cancel
This commit is contained in:
cdwcgt 2023-02-19 02:24:07 +09:00
parent 8446e7d841
commit 79715fe37b

View File

@ -35,13 +35,13 @@ namespace osu.Game.Database
/// <param name="cancellationToken">The Cancellation token that can cancel the exporting.</param>
private void exportZipArchive(TModel model, Stream outputStream, ProgressNotification notification, CancellationToken cancellationToken = default)
{
using var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate));
float i = 0;
bool fileMissing = false;
try
{
var writer = new ZipWriter(outputStream, new ZipWriterOptions(CompressionType.Deflate));
float i = 0;
bool fileMissing = false;
foreach (var file in model.Files)
{
cancellationToken.ThrowIfCancellationRequested();