From bbe5861367034284f2b64ac94e4cdd15e073d72a Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 8 Sep 2015 10:26:37 +0800 Subject: [PATCH] fix crash on xiaomi2 if cocos2d-x is built as a dynamic library --- cocos/network/SocketIO.cpp | 5 +++++ cocos/network/SocketIO.h | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index 58dd0de8ec..083b2071d8 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -1096,6 +1096,11 @@ void SIOClient::fireEvent(const std::string& eventName, const std::string& data) CCLOGINFO("SIOClient::fireEvent no native event with name %s found", eventName.c_str()); } + +void SIOClient::setTag(const char* tag) +{ + _tag = tag; +} //begin SocketIO methods SocketIO *SocketIO::_inst = nullptr; diff --git a/cocos/network/SocketIO.h b/cocos/network/SocketIO.h index 3456320cc6..5ad10d0f35 100644 --- a/cocos/network/SocketIO.h +++ b/cocos/network/SocketIO.h @@ -262,10 +262,8 @@ public: * The tag is used to distinguish the various SIOClient objects. * @param tag string object. */ - inline void setTag(const char* tag) - { - _tag = tag; - }; + void setTag(const char* tag); + /** * Get tag of SIOClient. * @return const char* the pointer point to the _tag.