Genius-x / genius-x

An Entity Component System framework based on Cocos2d-x
http://genius-x.org
165 stars 69 forks source link

释放etc加载alpha纹理不对吧 #18

Open tomisalready opened 8 years ago

tomisalready commented 8 years ago

`Texture2D::~Texture2D() {

if CC_ENABLE_CACHE_TEXTURE_DATA

VolatileTextureMgr::removeTexture(this);

endif

CCLOGINFO("deallocing Texture2D: %p - id=%u", this, _name);
CC_SAFE_RELEASE(_shaderProgram);

if(_name)
{
    GL::deleteTexture(_name);
}

if(_hasAlpha){
    Director::getInstance()->getTextureCache()->getTextureForKey(_alphaTexture)->release();
}

}`

_alphaTexture 这样直接release后, textureCache里面是否需要再 _textures.erase()对应的key呢?