예제 #1
0
 /// <summary>
 /// Disposes all resources (see <see cref="Flush(bool)"/>) and invokes the <see cref="CachePolicyManager.Unregister(string)"/> for the <see cref="PolicyKey"/>.
 /// </summary>
 public void Dispose()
 {
     lock (Lock)
     {
         Flush(true);
         CachePolicyManager.Unregister(PolicyKey);
     }
 }
예제 #2
0
파일: CacheCoreBase.cs 프로젝트: ostat/Beef
        /// <summary>
        /// Releases the unmanaged resources used by the <see cref="CacheCoreBase"/> and optionally releases the managed resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                lock (Lock)
                {
                    Flush(true);
                    CachePolicyManager.Unregister(PolicyKey);
                }
            }

            _disposed = true;
        }