mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
fix memory leak in handletouchpriority
This commit is contained in:
parent
912aa23833
commit
c8d1e88a97
1 changed files with 2 additions and 4 deletions
|
@ -500,15 +500,13 @@ void GEODE_DLL geode::cocos::handleTouchPriorityWith(cocos2d::CCNode* node, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void GEODE_DLL geode::cocos::handleTouchPriority(cocos2d::CCNode* node, bool force) {
|
void GEODE_DLL geode::cocos::handleTouchPriority(cocos2d::CCNode* node, bool force) {
|
||||||
node->retain();
|
Loader::get()->queueInMainThread([node = Ref(node), force]() {
|
||||||
Loader::get()->queueInMainThread([node, force]() {
|
if (auto delegate = typeinfo_cast<CCTouchDelegate*>(*node)) {
|
||||||
if (auto delegate = typeinfo_cast<CCTouchDelegate*>(node)) {
|
|
||||||
if (auto handler = CCTouchDispatcher::get()->findHandler(delegate)) {
|
if (auto handler = CCTouchDispatcher::get()->findHandler(delegate)) {
|
||||||
return handleTouchPriorityWith(node, handler->m_nPriority - 1, force);
|
return handleTouchPriorityWith(node, handler->m_nPriority - 1, force);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handleTouchPriorityWith(node, 0, force);
|
handleTouchPriorityWith(node, 0, force);
|
||||||
node->release();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue