mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-30 03:15:38 -05:00
fix weakref on CCTextInputNode
This commit is contained in:
parent
bc840ecb98
commit
2ce5680a6a
1 changed files with 4 additions and 0 deletions
|
@ -257,6 +257,10 @@ void WeakRefPool::check(CCObject* obj) {
|
|||
// if this object's only reference is the WeakRefPool aka only weak
|
||||
// references exist to it, then release it
|
||||
if (obj && m_pool.contains(obj) && obj->retainCount() == 1) {
|
||||
// set delegates to null because those aren't retained!
|
||||
if (auto input = typeinfo_cast<CCTextInputNode*>(obj)) {
|
||||
input->m_delegate = nullptr;
|
||||
}
|
||||
obj->release();
|
||||
// log::info("nullify {}", m_pool.at(obj).get());
|
||||
m_pool.at(obj)->m_obj = nullptr;
|
||||
|
|
Loading…
Reference in a new issue