mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15855 from mogemimi/fix-possible-leak
Fix possible memory leak when pass initialization fails
This commit is contained in:
commit
d8bd0ff8c8
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue