engine-native
engine-native copied to clipboard
when SIOClient::fireEvent the second time,crash.
void SIOClient::fireEvent(const std::string& eventName, const std::string& data)
{
CCLOGINFO("SIOClient::fireEvent called with event name: %s and data: %s", eventName.c_str(), data.c_str());
_delegate->fireEventToScript(this, eventName, data);
//if(_eventRegistry[eventName]) need to change
if(_eventRegistry.find(eventName) != _eventRegistry.end())
{
SIOEvent e = _eventRegistry[eventName];
e(this, data);
return;
}
CCLOGINFO("SIOClient::fireEvent no native event with name %s found", eventName.c_str());
}