Exemple #1
0
        private static void OnProxyDisposed(CacheItemProxy cacheItemProxy)
        {
            ReferenceCountedObjectWrapper <CacheItem> wrapper = cacheItemProxy.Wrapper;

            if (!wrapper.IsReferenceCountAboveZero())
            {
                lock (_syncLock)
                {
                    //The count could have gone back up
                    if (wrapper.IsReferenceCountAboveZero())
                    {
                        return;
                    }

                    CacheItem cacheItem = wrapper.Item;
                    _cache.Remove(cacheItem.Key);
                    cacheItem.Dispose();

                    if (_cache.Count == 0)
                    {
                        Trace.WriteLine("The composed lut cache is empty.", "LUT");
                    }
                }
            }
        }
Exemple #2
0
 private void DisposeCacheItemProxy()
 {
     if (_cacheItemProxy != null)
     {
         _cacheItemProxy.Dispose();
         _cacheItemProxy = null;
     }
 }
Exemple #3
0
			private void DisposeCacheItemProxy()
			{
				if (_cacheItemProxy != null)
				{
					_cacheItemProxy.Dispose();
					_cacheItemProxy = null;
				}
			}
Exemple #4
0
		private static void OnProxyDisposed(CacheItemProxy cacheItemProxy)
		{
			ReferenceCountedObjectWrapper<CacheItem> wrapper = cacheItemProxy.Wrapper;
			if (!wrapper.IsReferenceCountAboveZero())
			{
				lock (_syncLock)
				{
					//The count could have gone back up
					if (wrapper.IsReferenceCountAboveZero())
						return;

					CacheItem cacheItem = wrapper.Item;
					_cache.Remove(cacheItem.Key);
					cacheItem.Dispose();

					if (_cache.Count == 0)
						Trace.WriteLine("The composed lut cache is empty.", "LUT");
				}
			}
		}