fix multiple weak refs causing a memory leak

This commit is contained in:
hjfod 2023-03-31 11:36:54 +03:00
parent e92541a655
commit 0e4636284b

View file

@ -253,7 +253,7 @@ bool WeakRefPool::isManaged(CCObject* obj) {
} }
void WeakRefPool::manage(CCObject* obj) { void WeakRefPool::manage(CCObject* obj) {
if (obj) { if (obj && !m_pool.contains(obj)) {
obj->retain(); obj->retain();
m_pool.insert(obj); m_pool.insert(obj);
} }