コード例 #1
0
        private bool InternalDestroyObjectPool(string fullName)
        {
            ObjectPoolBase objectPool = null;

            if (m_ObjectPools.TryGetValue(fullName, out objectPool))
            {
                objectPool.Shutdown();
                return(m_ObjectPools.Remove(fullName));
            }

            return(false);
        }
コード例 #2
0
        /// <summary>
        /// 销毁对象池。
        /// </summary>
        /// <typeparam name="T">对象类型。</typeparam>
        /// <param name="name">要销毁的对象池名称。</param>
        /// <returns>是否销毁对象池成功。</returns>
        public bool DestroyObjectPool <T>(string name) where T : ObjectBase
        {
            string         fullName   = Utility.Text.GetFullName <T>(name);
            ObjectPoolBase objectPool = null;

            if (m_ObjectPools.TryGetValue(fullName, out objectPool))
            {
                objectPool.Shutdown();
                return(m_ObjectPools.Remove(fullName));
            }

            return(false);
        }