TileSprites weren't destroying WebGL textures, leading to eventual out of memory errors (thanks @chacal #1563)

This commit is contained in:
photonstorm 2015-02-03 21:32:25 +00:00
parent f55ba6755f
commit 336fdfa672
3 changed files with 19 additions and 0 deletions

View file

@ -87,6 +87,10 @@ Version 2.3.0 - "Tarabon" - in dev
* Error in diffX and diffY calculation in Tilemap.paste (thanks @amelia410 #1446)
* Fixed issue in PIXI.canUseNewCanvasBlendModes which would create false positives in browsers that supported `multiply` in Canvas path/fill ops, but not for `drawImage` (Samsung S5 for example). Now uses more accurate magenta / yellow mix test.
* Fixed FrameData.getFrame index out of bound error (thanks @jromer94 #1581 #1547)
* In P2.Body calling adjust mass would desync the debug graphics from the real position of the body (thanks @tomlarkworthy #1549)
* Fix CORS loading of BitmapFonts with IE9 (thanks @jeppester #1565)
* TileSprites were not detecting Pointer up events correctly because of a branching condition (thanks @integricho #1580 #1551)
* TileSprites weren't destroying WebGL textures, leading to eventual out of memory errors (thanks @chacal #1563)
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).

View file

@ -499,6 +499,8 @@ Phaser.TileSprite.prototype.destroy = function(destroyChildren) {
this._cache[8] = 0;
PIXI.TilingSprite.prototype.destroy.call(this);
};
/**

View file

@ -462,3 +462,16 @@ PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo)
this.tilingTexture.baseTexture._powerOf2 = true;
};
PIXI.TilingSprite.prototype.destroy = function () {
PIXI.Sprite.prototype.destroy.call(this);
this.tileScale = null;
this.tileScaleOffset = null;
this.tilePosition = null;
this.tilingTexture.destroy(true);
this.tilingTexture = null;
};