Added Memory Tracking Code

This commit is contained in:
Rich
2012-05-21 13:34:22 +00:00
parent c8de9f8538
commit ab1cd8af42
202 changed files with 4617 additions and 122 deletions

View File

@@ -37,9 +37,13 @@ namespace VEPROMS.CSLA.Library
if (IsDirty)
refreshPdfs.Add(this);
}
private void BuildRefreshList()
private void ClearRefreshList()
{
_RefreshPdfs = new List<Pdf>();
}
private void BuildRefreshList()
{
ClearRefreshList();
AddToRefreshList(_RefreshPdfs);
}
private void ProcessRefreshList()
@@ -49,6 +53,7 @@ namespace VEPROMS.CSLA.Library
PdfInfo.Refresh(tmp);
if (tmp._MyDocument != null) DocumentInfo.Refresh(tmp._MyDocument);
}
ClearRefreshList();
}
#endregion
#region Collection
@@ -426,8 +431,28 @@ namespace VEPROMS.CSLA.Library
{/* require use of factory methods */
AddToCache(this);
}
private bool _Disposed = false;
private static int _CountCreated = 0;
private static int _CountDisposed = 0;
private static int _CountFinalized = 0;
private static int IncrementCountCreated
{ get { return ++_CountCreated; } }
private int _CountWhenCreated = IncrementCountCreated;
public static int CountCreated
{ get { return _CountCreated; } }
public static int CountNotDisposed
{ get { return _CountCreated - _CountDisposed; } }
public static int CountNotFinalized
{ get { return _CountCreated - _CountFinalized; } }
~Pdf()
{
_CountFinalized++;
}
public void Dispose()
{
if (_Disposed) return;
_CountDisposed++;
_Disposed = true;
RemoveFromDictionaries();
}
private void RemoveFromDictionaries()