Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh the search paths #11195

Closed
wants to merge 1 commit into from
Closed

refresh the search paths #11195

wants to merge 1 commit into from

Conversation

kpkhxlgy0
Copy link
Contributor

When I set the workdir in the command line on mac platform, it not affect the search paths, because the search paths set first, _defaultResRootPath is null string, so refresh the search paths can solve it.

@@ -846,6 +846,7 @@ void FileUtils::setWritablePath(const std::string& writablePath)
void FileUtils::setDefaultResourceRootPath(const std::string& path)
{
_defaultResRootPath = path;
setSearchPaths(_searchPathArray);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good catch.

But i think this line
https://github.com/kpkhxlgy0/cocos2d-x/blob/e87207462912eef8235dfcab568eb4405a599002/cocos/platform/CCFileUtils.cpp#L857

will make the searchPaths parameter cleared.

We need to make a copy of searchPaths parameter before clear.

@dumganhar dumganhar self-requested a review March 3, 2017 04:54
@dumganhar dumganhar self-assigned this Mar 3, 2017
@dumganhar dumganhar added this to the next milestone Mar 3, 2017
@dumganhar
Copy link

I submitted a new Pull Request (#17435) to fix this issue, it also resolves some other issues I found in FileUtils.

Therefore, I closed this one.

@dumganhar dumganhar closed this Mar 3, 2017
@minggo minggo removed this from the 3.16 milestone Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants