菜鸟 ui动画的一部分代码有疑问

void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::Value &dic,Object* root)
{
std::string path = jsonName;
ssize_t pos = path.find_last_of("/");
std::string fileName = path.substr(pos+1,path.length());
CCLOG(“filename == %s”,fileName.c_str());
cocos2d::Vector<ActionObject*> actionList;
int actionCount = DICTOOL->getArrayCount_json(dic, “actionlist”);
for (int i=0; i<actionCount; i++) {
ActionObject* action = new ActionObject();
action->autorelease();
const rapidjson::Value &actionDic = DICTOOL->getDictionaryFromArray_json(dic, “actionlist”, i);
action->initWithDictionary(actionDic,root);
actionList.pushBack(action);
}
_actionDic.insert(std::pair<std::string, cocos2d::Vector<ActionObject*>>(fileName, actionList));
}
这里用一个局部的Vector保存在一个std::map里,函数结束Vector不就被释放掉了么
而且这个Vector的析构函数里面有调用了clear方法
为什么这样也可以…
求教…
谢谢