mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fixed texture destroy
This commit is contained in:
@@ -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();
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user