Merge pull request #15855 from mogemimi/fix-possible-leak

Fix possible memory leak when pass initialization fails
This commit is contained in:
minggo 2016-06-16 11:04:03 +08:00 committed by GitHub
commit d8bd0ff8c8
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,7 @@ Pass* Pass::create(Technique* technique)
pass->autorelease();
return pass;
}
CC_SAFE_DELETE(pass);
return nullptr;
}
@ -63,6 +64,7 @@ Pass* Pass::createWithGLProgramState(Technique* technique, GLProgramState* progr
pass->autorelease();
return pass;
}
CC_SAFE_DELETE(pass);
return nullptr;
}