Explicitly destroy old gl texture before update

This commit is contained in:
pandamicro
2018-04-08 00:40:07 +08:00
parent c89ee01a56
commit 86585d6a01
+3
View File
@@ -362,6 +362,9 @@ var Texture2D = cc.Class({
this._image = options.images[0];
}
else if (options.image !== undefined) {
// Release previous gl texture if existed
this._texture.destroy();
this._image = options.image;
if (!options.images) {
_images.length = 0;