B2014-109: Fix crash on section delete – cache list was updated by sub-code and then enumeration crashed.

This commit is contained in:
Kathy Ruffing 2014-11-05 14:55:13 +00:00
parent 8c85f817d1
commit fd96809f2a

View File

@ -669,9 +669,16 @@ 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<ItemInfo> myCache = new List<ItemInfo>();
foreach (ItemInfo item in _CacheByPrimaryKey[key]) myCache.Add(item);
foreach (ItemInfo item in myCache)
item.OnOrdinalChange();
}
}
public bool IsFirstSubStep
{
get