/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or /// resetting unmanaged resources. /// </summary> /// <param name="disposing"></param> private void Dispose(bool disposing) { lock (this) { if (SerializationContext != null) { CompactFormatterServices.UnregisterAllCustomCompactTypes(SerializationContext); } if (PerfStatsColl != null) { PerfStatsColl.Dispose(); PerfStatsColl = null; } if (ExpiryMgr != null) { ExpiryMgr.Dispose(); ExpiryMgr = null; } if (MessageManager != null) { MessageManager.StopMessageProcessing(); MessageManager = null; } if (CacheImpl != null) { CacheImpl.Dispose(); CacheImpl = null; } if (TimeSched != null) { TimeSched.Dispose(); TimeSched = null; } if (AsyncProc != null) { AsyncProc.Stop(); AsyncProc = null; } if (HealthCollectorTimeSched != null) { HealthCollectorTimeSched.Dispose(); HealthCollectorTimeSched = null; } if (disposing) { GC.SuppressFinalize(this); } } }
public void Dispose() { if (_asyncProcessor != null) { _asyncProcessor.Stop(); _asyncProcessor = null; } if (_indexMap != null) { _indexMap.Clear(); _indexMap = null; } _cache = null; }