From 11d38607811d1f2dca58bc3d99b4ad698d6b228a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 21 Jun 2017 21:38:12 +0100 Subject: avoid some broken object assets present in osgrid inventories due to past problems, etc --- .../Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 2 ++ .../Avatar/Inventory/Archiver/InventoryArchiverModule.cs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index dde93db..2735b59 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -381,6 +381,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); Exception e = new InventoryArchiverException(errorMessage); m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e, 0, 0); + if(m_saveStream != null && m_saveStream.CanWrite) + m_saveStream.Close(); throw e; } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index be59eb5..06aec7b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -218,7 +218,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // { try { - new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService); + InventoryArchiveWriteRequest iarReq = new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream); + iarReq.Execute(options, UserAccountService); } catch (EntryPointNotFoundException e) { @@ -261,7 +262,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // { try { - new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService); + InventoryArchiveWriteRequest iarReq = new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath); + iarReq.Execute(options, UserAccountService); } catch (EntryPointNotFoundException e) { -- cgit v1.1