From 33a8db9dce756c5550cec613cdb3d248a5ec2115 Mon Sep 17 00:00:00 2001 From: Wesley Simon Date: Thu, 19 Sep 2019 16:05:00 -0600 Subject: [PATCH] Add using so stream will close properly --- .../ExportImport/PlatformExportImportManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/VirtoCommerce.Platform.Data/ExportImport/PlatformExportImportManager.cs b/VirtoCommerce.Platform.Data/ExportImport/PlatformExportImportManager.cs index 9cb4a60c8..3d0f94ab5 100644 --- a/VirtoCommerce.Platform.Data/ExportImport/PlatformExportImportManager.cs +++ b/VirtoCommerce.Platform.Data/ExportImport/PlatformExportImportManager.cs @@ -433,7 +433,11 @@ void ModuleProgressCallback(ExportImportProgressInfo x) var options = manifest.Options .DefaultIfEmpty(new ExportImportOptions { HandleBinaryData = manifest.HandleBinaryData, ModuleIdentity = new ModuleIdentity(module.Id, SemanticVersion.Parse(module.Version)) }) .FirstOrDefault(x => x.ModuleIdentity.Id == moduleDescriptor.Identity.Id); - await exporter.ExportAsync(zipEntry.Open(), options, ModuleProgressCallback, cancellationToken); + + using (var stream = zipEntry.Open()) + { + await exporter.ExportAsync(stream, options, ModuleProgressCallback, cancellationToken); + } } catch (Exception ex) {