Exemple #1
0
        /// Releases the entity. An owner can only release an entity
        /// if it retains it.
        /// Retain/Release is part of AERC (Automatic Entity Reference Counting)
        /// and is used internally to prevent pooling retained entities.
        /// If you use retain manually you also have to
        /// release it manually at some point.
        public void Release(object owner = null)
        {
            mAERC.Release(owner);
            mToStringCache = null;

            if (mAERC.RefCount == 0)
            {
                if (OnEntityReleased != null)
                {
                    OnEntityReleased(this);
                }
            }
        }
        public void UnloadCache(string key)
        {
            if (!base.Contains(key))
            {
                return;
            }

            IRefCounter counter = base.Get(key);

            counter.Release();

            if (counter.refCount == 0)
            {
                base.Remove(key);
            }
        }
Exemple #3
0
        public void UnloadCache(string key)
        {
            if (!base.Contains(key))
            {
                return;
            }

            IRefCounter counter = base.Get(key);

            counter.Release();
            //CDebug.LogError("TextureCache Release key " + key + " ref " + counter.refCount);

            if (counter.refCount == 0)
            {
                base.Remove(key);
            }
        }