We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 195dc70 commit bc1483dCopy full SHA for bc1483d
cocos/renderer/CCTexture2D.cpp
@@ -897,9 +897,10 @@ void Texture2D::removeSpriteFrameCapInset(SpriteFrame* spriteFrame)
897
void Texture2D::setAlphaTexture(Texture2D* alphaTexture)
898
{
899
if (alphaTexture != nullptr) {
900
- this->_alphaTexture = alphaTexture;
901
- this->_alphaTexture->retain();
902
- this->_hasPremultipliedAlpha = true; // PremultipliedAlpha should be true.
+ alphaTexture->retain();
+ CC_SAFE_RELEASE(_alphaTexture);
+ _alphaTexture = alphaTexture;
903
+ _hasPremultipliedAlpha = true; // PremultipliedAlpha should be true.
904
}
905
906
0 commit comments