I have a question while looking at the source code.
In the Release function, use m_Stack.Peek to check if the object has already been released.
why use Peek without using the m_Stack.Containe function?
If use it like this, ObjectPool.countInactive is 3.
please answer about my question.
public class AAAA
{
}
public class PoolTest
{
List<AAAA> m_AAA1 = ListPool<AAAA>.Get();
List<AAAA> m_AAA2 = ListPool<AAAA>.Get();
public void Init()
{
}
public void Clear()
{
ListPool<AAAA>.Release(m_AAA1);
ListPool<AAAA>.Release(m_AAA2);
ListPool<AAAA>.Release(m_AAA1);
}
}