B2022-025: Barakah print/merge of alarm gets out of memory error – dispose procs loaded in when resolving transition text

Added a null check
Added some aids for debugging the contentinfo cache
This commit is contained in:
2022-02-14 13:41:19 +00:00
parent bb81c62e3e
commit d4b7ea08a0
3 changed files with 65 additions and 4 deletions

View File

@@ -555,7 +555,15 @@ namespace VEPROMS.CSLA.Library
#region Factory Methods
private static int _ContentInfoUnique = 0;
private static int ContentInfoUnique
{ get { return ++_ContentInfoUnique; } }
{
get
{
int ui = ++_ContentInfoUnique;
// to debug to see where this gets allocated use the following code:
//if (ui == 2|| ui == 6) Console.WriteLine("Here");
return ui;
}
}
private int _MyContentInfoUnique = ContentInfoUnique;
public int MyContentInfoUnique // Absolutely Unique ID - Info
{ get { return _MyContentInfoUnique; } }
@@ -580,6 +588,23 @@ namespace VEPROMS.CSLA.Library
{
_CountFinalized++;
}
// Use PrintCache in the CacheUsage.cs/CSLACache.Usage call to see what is in the cache for Contents.
// for printing the contentinfo objects in the cache, add the line 'ContentInfo.PrintCache();' to that method.
// NOTE that similar code can be added for the various csla wrapper objects, such as grid & item.
public static void PrintCache()
{
foreach (string str in _CacheByPrimaryKey.Keys)
{
List<ContentInfo> listContentInfo = _CacheByPrimaryKey[str]; // Get the list of items
if (listContentInfo.Count >1) Console.WriteLine("**Cache - {0}, count = {1}", str, listContentInfo.Count);
if (listContentInfo.Count > 1)
{
Console.WriteLine("**Cache - {0}, count = {1}", str, listContentInfo.Count);
foreach (ContentInfo ci in listContentInfo) Console.WriteLine(" num = {0}, uniqid = {1}, txt = {2}", ci.Number.Replace(@"\u8209?", "-"), ci.MyContentInfoUnique, ci.Text);
}
}
}
public void Dispose()
{
if (_Disposed) return;