mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
DynamicTexture.setSize
will now check to see if the glTexture
bound to the current frame is stale, and if so, destroy it before binding the one from the Render Target. This fixes an issue where constantly destroy and creating Dynamic Textures would cause a memory leak in WebGL. Fix #6669
This commit is contained in:
parent
ab6776e69f
commit
97967288b6
1 changed files with 3 additions and 0 deletions
|
@ -269,7 +269,10 @@ var DynamicTexture = new Class({
|
|||
if (renderTarget.willResize(width, height))
|
||||
{
|
||||
renderTarget.resize(width, height);
|
||||
}
|
||||
|
||||
if (renderTarget.texture !== source.glTexture)
|
||||
{
|
||||
// The WebGLTexture has been resized, so is new, so we need to delete the old one
|
||||
this.renderer.deleteTexture(source.glTexture);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue