DynamicTexture.preDestroy was never called, leading to an accumlation of framebuffers in memory. This method has now been renamed to destroy and cleans all references correctly.

This commit is contained in:
Richard Davey 2023-09-05 12:55:01 +01:00
parent ef7c06d639
commit c82a6bb466

View file

@ -1544,14 +1544,15 @@ var DynamicTexture = new Class({
},
/**
* Internal destroy handler, called as part of the destroy process.
* Destroys this Texture and releases references to its sources and frames.
*
* @method Phaser.Textures.DynamicTexture#preDestroy
* @protected
* @since 3.9.0
* @method Phaser.Textures.DynamicTexture#destroy
* @since 3.60.0
*/
preDestroy: function ()
destroy: function ()
{
Texture.prototype.destroy.call(this);
CanvasPool.remove(this.canvas);
if (this.renderTarget)
@ -1560,12 +1561,10 @@ var DynamicTexture = new Class({
}
this.camera.destroy();
this.stamp.destroy();
this.canvas = null;
this.context = null;
this.renderer = null;
this.scene = null;
}
});