Merge pull request #7165 from timur-losev/v3

- Due to the fact that map::insert doesn't allow to insert an element by...
This commit is contained in:
minggo 2014-06-25 17:34:28 +08:00
commit 0ef26e208b
1 changed files with 4 additions and 2 deletions

View File

@ -387,8 +387,10 @@ GLProgram* GLProgramCache::getGLProgram(const std::string &key)
void GLProgramCache::addGLProgram(GLProgram* program, const std::string &key)
{
program->retain();
_programs.insert( std::make_pair( key, program) );
if (program)
program->retain();
_programs[key] = program;
}
NS_CC_END