示例#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");
                    }
                }
            }
        }
示例#2
0
 private void DisposeCacheItemProxy()
 {
     if (_cacheItemProxy != null)
     {
         _cacheItemProxy.Dispose();
         _cacheItemProxy = null;
     }
 }
示例#3
0
			private void DisposeCacheItemProxy()
			{
				if (_cacheItemProxy != null)
				{
					_cacheItemProxy.Dispose();
					_cacheItemProxy = null;
				}
			}
示例#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");
				}
			}
		}