fix: copy map when getParseCallBackMap() and getParseObjectMap()

This commit is contained in:
lite3 2014-08-12 17:05:23 +08:00
parent 46cdd6f8dd
commit 69e2b815ed
2 changed files with 6 additions and 6 deletions

View File

@ -1512,11 +1512,11 @@ void WidgetPropertiesReader0300::setPropsForAllCustomWidgetFromJsonDictionary(co
{ {
GUIReader* guiReader = GUIReader::getInstance(); GUIReader* guiReader = GUIReader::getInstance();
std::map<std::string, Ref*> object_map = GUIReader::getInstance()->getParseObjectMap(); std::map<std::string, Ref*> *object_map = guiReader->getParseObjectMap();
Ref* object = object_map[classType]; Ref* object = (*object_map)[classType];
std::map<std::string, SEL_ParseEvent> selector_map = guiReader->getParseCallBackMap(); std::map<std::string, SEL_ParseEvent> *selector_map = guiReader->getParseCallBackMap();
SEL_ParseEvent selector = selector_map[classType]; SEL_ParseEvent selector = (*selector_map)[classType];
if (object && selector) if (object && selector)
{ {

View File

@ -85,8 +85,8 @@ protected:
ParseObjectMap _mapObject; ParseObjectMap _mapObject;
public: public:
ParseCallBackMap getParseCallBackMap() { return _mapParseSelector; }; ParseCallBackMap* getParseCallBackMap() { return &_mapParseSelector; };
ParseObjectMap getParseObjectMap() { return _mapObject; }; ParseObjectMap* getParseObjectMap() { return &_mapObject; };
}; };