EventDispatcher - readding


#1

What’s the issue?
I believe, EventDispatcher is not unregistered correctly, if it is added, removed and added back again in a row. On final adding we got assert on isRegistered check.

for(auto iter = _toAddedListeners.begin(); iter != _toAddedListeners.end(); ++iter)
{
if (*iter == listener)
{
listener->setRegistered(false); // this row should be added in .cpp
listener->release();
_toAddedListeners.erase(iter);
break;
}
}

What’s the engine version?
3.0rc1

How to reproduce it?
added, removed and added back again in a row.


#2

@Delka, thanks for your feedback.
I created a ticket at http://cocos2d-x.org/issues/4700 . I will fix it next week. :slight_smile:


#3

Fixed at https://github.com/cocos2d/cocos2d-x/pull/6157
Thanks. :slight_smile: