From fd96809f2a5865d1a91bf8eeba7c789faa610c73 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 5 Nov 2014 14:55:13 +0000 Subject: [PATCH] =?UTF-8?q?B2014-109:=20Fix=20crash=20on=20section=20delet?= =?UTF-8?q?e=20=E2=80=93=20cache=20list=20was=20updated=20by=20sub-code=20?= =?UTF-8?q?and=20then=20enumeration=20crashed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 2911bed8..6f0e081f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -669,8 +669,15 @@ namespace VEPROMS.CSLA.Library ConvertListToDictionary(); string key = itemID.ToString(); if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo item in _CacheByPrimaryKey[key]) + { + // Create a temporary list to process cache entries then use + // the temporary list which may have a side effect on the cache entries, + // thus the need for the temporary list. + List myCache = new List(); + foreach (ItemInfo item in _CacheByPrimaryKey[key]) myCache.Add(item); + foreach (ItemInfo item in myCache) item.OnOrdinalChange(); + } } public bool IsFirstSubStep {