Added Memory Tracking Code
This commit is contained in:
@@ -45,10 +45,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
private void BuildRefreshList()
|
||||
private void ClearRefreshList()
|
||||
{
|
||||
_RefreshConnections = new List<Connection>();
|
||||
_RefreshConnectionFolders = new List<ConnectionFolder>();
|
||||
}
|
||||
private void BuildRefreshList()
|
||||
{
|
||||
ClearRefreshList();
|
||||
AddToRefreshList(_RefreshConnections, _RefreshConnectionFolders);
|
||||
}
|
||||
private void ProcessRefreshList()
|
||||
@@ -61,6 +65,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
FolderInfo.Refresh(tmp);
|
||||
}
|
||||
ClearRefreshList();
|
||||
}
|
||||
#endregion
|
||||
#region Collection
|
||||
@@ -510,8 +515,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; } }
|
||||
~Connection()
|
||||
{
|
||||
_CountFinalized++;
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
if (_Disposed) return;
|
||||
_CountDisposed++;
|
||||
_Disposed = true;
|
||||
RemoveFromDictionaries();
|
||||
}
|
||||
private void RemoveFromDictionaries()
|
||||
|
Reference in New Issue
Block a user