mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 02:02:41 +08:00
Explicitly destroy old gl texture before update
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user