Added Memory Tracking Code
This commit is contained in:
@@ -84,7 +84,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
private void BuildRefreshList()
|
||||
private void ClearRefreshList()
|
||||
{
|
||||
_RefreshItems = new List<Item>();
|
||||
_RefreshItemAnnotations = new List<ItemAnnotation>();
|
||||
@@ -92,6 +92,10 @@ namespace VEPROMS.CSLA.Library
|
||||
_RefreshItemParts = new List<ItemPart>();
|
||||
_RefreshItemTransitions_RangeID = new List<ItemTransition_RangeID>();
|
||||
_RefreshItemTransitions_ToID = new List<ItemTransition_ToID>();
|
||||
}
|
||||
private void BuildRefreshList()
|
||||
{
|
||||
ClearRefreshList();
|
||||
AddToRefreshList(_RefreshItems, _RefreshItemAnnotations, _RefreshItemDocVersions, _RefreshItemParts, _RefreshItemTransitions_RangeID, _RefreshItemTransitions_ToID);
|
||||
}
|
||||
private void ProcessRefreshList()
|
||||
@@ -121,6 +125,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
TransitionInfo.Refresh(tmp);
|
||||
}
|
||||
ClearRefreshList();
|
||||
}
|
||||
#endregion
|
||||
#region Collection
|
||||
@@ -707,8 +712,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; } }
|
||||
~Item()
|
||||
{
|
||||
_CountFinalized++;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
if (_Disposed) return;
|
||||
_CountDisposed++;
|
||||
_Disposed = true;
|
||||
if (_MyContent != null)
|
||||
{
|
||||
_MyContent.Dispose();
|
||||
|
Reference in New Issue
Block a user