Merge pull request #6781 from dabingnn/v3_work

V3 work
This commit is contained in:
Ricardo Quesada 2014-05-16 11:04:49 -07:00
commit 6837cea2e6
1 changed files with 8 additions and 5 deletions

View File

@ -240,11 +240,14 @@ void VertexAttribValue::setPointer(GLint size, GLenum type, GLboolean normalized
GLProgramState* GLProgramState::create(GLProgram *glprogram) GLProgramState* GLProgramState::create(GLProgram *glprogram)
{ {
GLProgramState* ret = nullptr; GLProgramState* ret = nullptr;
ret = new (std::nothrow) GLProgramState; ret = new (std::nothrow) GLProgramState();
if(!ret || !ret->init(glprogram)) if(ret && ret->init(glprogram))
CC_SAFE_RELEASE(ret); {
ret->autorelease();
return ret; return ret;
}
CC_SAFE_DELETE(ret);
return nullptr;
} }
GLProgramState* GLProgramState::getOrCreateWithGLProgramName(const std::string &glProgramName ) GLProgramState* GLProgramState::getOrCreateWithGLProgramName(const std::string &glProgramName )