fixed texture destroy

This commit is contained in:
fusijie
2018-02-01 14:14:21 +08:00
parent 62d1e03cd2
commit 7909bd99fa
+2 -2
View File
@@ -415,7 +415,7 @@ var Texture2D = cc.Class({
*/
destroy () {
this._image = null;
this._texture.destroy();
this._texture && this._texture.destroy();
// TODO cc.textureUtil ?
// cc.textureCache.removeTextureForKey(this.url); // item.rawUrl || item.url
this._super();
@@ -506,7 +506,7 @@ var Texture2D = cc.Class({
*/
releaseTexture () {
this._image = null;
this._texture.destroy();
this._texture && this._texture.destroy();
},
/**