{"action":"closed","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/15571","repository_url":"https://api.github.com/repos/cocos2d/cocos2d-x","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/15571/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/15571/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/15571/events","html_url":"https://github.com/cocos2d/cocos2d-x/issues/15571","id":153180515,"number":15571,"title":"Logic error in `ConfigParser::readConfig`","user":{"login":"youlanhai","id":3377270,"avatar_url":"https://avatars.githubusercontent.com/u/3377270?v=3","gravatar_id":"","url":"https://api.github.com/users/youlanhai","html_url":"https://github.com/youlanhai","followers_url":"https://api.github.com/users/youlanhai/followers","following_url":"https://api.github.com/users/youlanhai/following{/other_user}","gists_url":"https://api.github.com/users/youlanhai/gists{/gist_id}","starred_url":"https://api.github.com/users/youlanhai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youlanhai/subscriptions","organizations_url":"https://api.github.com/users/youlanhai/orgs","repos_url":"https://api.github.com/users/youlanhai/repos","events_url":"https://api.github.com/users/youlanhai/events{/privacy}","received_events_url":"https://api.github.com/users/youlanhai/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"minggo","id":488203,"avatar_url":"https://avatars.githubusercontent.com/u/488203?v=3","gravatar_id":"","url":"https://api.github.com/users/minggo","html_url":"https://github.com/minggo","followers_url":"https://api.github.com/users/minggo/followers","following_url":"https://api.github.com/users/minggo/following{/other_user}","gists_url":"https://api.github.com/users/minggo/gists{/gist_id}","starred_url":"https://api.github.com/users/minggo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minggo/subscriptions","organizations_url":"https://api.github.com/users/minggo/orgs","repos_url":"https://api.github.com/users/minggo/repos","events_url":"https://api.github.com/users/minggo/events{/privacy}","received_events_url":"https://api.github.com/users/minggo/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/milestones/27","html_url":"https://github.com/cocos2d/cocos2d-x/milestones/next","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/milestones/27/labels","id":1460593,"number":27,"title":"next","description":"","creator":{"login":"pandamicro","id":632460,"avatar_url":"https://avatars.githubusercontent.com/u/632460?v=3","gravatar_id":"","url":"https://api.github.com/users/pandamicro","html_url":"https://github.com/pandamicro","followers_url":"https://api.github.com/users/pandamicro/followers","following_url":"https://api.github.com/users/pandamicro/following{/other_user}","gists_url":"https://api.github.com/users/pandamicro/gists{/gist_id}","starred_url":"https://api.github.com/users/pandamicro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandamicro/subscriptions","organizations_url":"https://api.github.com/users/pandamicro/orgs","repos_url":"https://api.github.com/users/pandamicro/repos","events_url":"https://api.github.com/users/pandamicro/events{/privacy}","received_events_url":"https://api.github.com/users/pandamicro/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":102,"state":"open","created_at":"2015-12-15T02:48:07Z","updated_at":"2016-05-06T08:48:48Z","due_on":"2016-06-29T16:00:00Z","closed_at":null},"comments":2,"created_at":"2016-05-05T07:07:55Z","updated_at":"2016-05-06T08:48:48Z","closed_at":"2016-05-06T08:48:48Z","body":"The temporary search path was inserted into the begin of the array, but the last element was removed from the array when operation finished.\r\n\r\nhttps://github.com/cocos2d/cocos2d-x/blob/v3/tools/simulator/libsimulator/lib/runtime/ConfigParser.cpp\r\n```c++\r\nvoid ConfigParser::readConfig(const string &filepath)\r\n{\r\n    ...\r\n    // add writable path to search path temporarily for reading config file\r\n    vector<std::string> searchPathArray = FileUtils::getInstance()->getSearchPaths();\r\n    searchPathArray.insert(searchPathArray.begin(), FileServer::getShareInstance()->getWritePath());\r\n    FileUtils::getInstance()->setSearchPaths(searchPathArray);\r\n    ...\r\n    // revert search path\r\n    searchPathArray.erase(searchPathArray.end() - 1);\r\n    FileUtils::getInstance()->setSearchPaths(searchPathArray);\r\n    ...\r\n}\r\n```\r\nNotice, the code `searchPathArray.erase(searchPathArray.end() - 1);` means to erase the last element."}}