mirror of
https://github.com/u0u0/Cocos2d-Lua-Community.git
synced 2026-05-07 06:07:25 +08:00
事件回调中删除自己的异常保护。
This commit is contained in:
@@ -812,6 +812,9 @@ void Widget::onTouchMoved(Touch *touch, Event* /*unusedEvent*/)
|
||||
|
||||
void Widget::onTouchEnded(Touch *touch, Event* /*unusedEvent*/)
|
||||
{
|
||||
// if self be released in propagateTouchEvent, may crash at setHighlighted.
|
||||
// use retain() to avoid such case.
|
||||
this->retain();
|
||||
_touchEndPosition = touch->getLocation();
|
||||
|
||||
/*
|
||||
@@ -833,6 +836,7 @@ void Widget::onTouchEnded(Touch *touch, Event* /*unusedEvent*/)
|
||||
{
|
||||
cancelUpEvent();
|
||||
}
|
||||
this->release();
|
||||
}
|
||||
|
||||
void Widget::onTouchCancelled(Touch* touch, Event* /*unusedEvent*/)
|
||||
|
||||
Reference in New Issue
Block a user