Exemplo n.º 1
0
 /// <summary>
 /// Libera a instancia.
 /// </summary>
 /// <param name="disposing"></param>
 private void Dispose(bool disposing)
 {
     lock (this)
     {
         if (this.SerializationContext != null)
         {
             CompactFormatterServices.UnregisterAllCustomCompactTypes(this.SerializationContext);
         }
         if (this.ExpiryMgr != null)
         {
             this.ExpiryMgr.Dispose();
             this.ExpiryMgr = null;
         }
         if (this.CacheImpl != null)
         {
             this.CacheImpl.Dispose();
             this.CacheImpl = null;
         }
         if (this.TimeSched != null)
         {
             this.TimeSched.Dispose();
             this.TimeSched = null;
         }
         if (this.AsyncProc != null)
         {
             this.AsyncProc.Stop();
             this.AsyncProc = null;
         }
         if (disposing)
         {
             GC.SuppressFinalize(this);
         }
     }
 }
Exemplo n.º 2
0
        /// <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);
                }
            }
        }