ClearCache() public static method

清理缓存释放资源
public static ClearCache ( int assethashcode ) : void
assethashcode int
return void
示例#1
0
        /// <summary>
        /// 目标引用减一
        /// </summary>
        /// <param name="hashcode"></param>
        /// <returns></returns>
        internal static bool Subtract(int hashcode)
        {
            CacheData cached = CacheManager.GetCache(hashcode);

            if (cached != null)
            {
                cached.count--;        // = cached.count - 1;
                if (cached.count <= 0) //所有引用被清理。
                {
                    CacheManager.ClearCache(hashcode);
                }
                return(true);
            }

            return(false);
        }