Skip to content

Commit 18b867f

Browse files
author
pandamicro
committed
Fix cc.textureCache.removeTextureForKey not releasing texture issue
1 parent 5939d41 commit 18b867f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cocos2d/core/textures/CCTextureCache.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,11 @@ cc.textureCache = /** @lends cc.textureCache# */{
214214
removeTextureForKey: function (textureKeyName) {
215215
if (textureKeyName == null)
216216
return;
217-
if (this._textures[textureKeyName])
217+
var tex = this._textures[textureKeyName];
218+
if (tex) {
219+
tex.releaseTexture();
218220
delete(this._textures[textureKeyName]);
221+
}
219222
},
220223

221224
//addImage move to Canvas/WebGL

0 commit comments

Comments
 (0)