Skip to content

Commit b13acdb

Browse files
committed
TilingSprite.destroy fixed if TilingSprite hasn't ever been rendered (phaserjs#1663)
1 parent 5a9b509 commit b13acdb

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,13 @@ We've also removed functions and properties from Pixi classes that Phaser doesn'
209209
* P2 Debug Body class: The shape check in draw() needed to check for Convex last, since other shapes (like Rectangle) inherit from Convex (thanks @englercj #1674)
210210
* P2 Debug Body class: The updateSpriteTransform() function needed to be called from the ctor. Otherwise bodies with no sprite (so no postUpdate call) would never be moved to draw in the correct position (thanks @englercj #1674)
211211

212-
### Pixi 2.2.7 Bug Fixes
212+
### Pixi 2.2.8 Bug Fixes
213213

214214
* SpriteBatch added fix to handle batch context loss on change.
215215
* RenderTexture resolution fix.
216216
* WebGL Filter Resolution fix.
217217
* TilingSprite fixes when masked in canvas mode.
218+
* TilingSprite.destroy fixed if TilingSprite hasn't ever been rendered.
218219

219220
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
220221

src/pixi/extras/TilingSprite.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,10 @@ PIXI.TilingSprite.prototype.destroy = function () {
488488
this.tileScaleOffset = null;
489489
this.tilePosition = null;
490490

491-
this.tilingTexture.destroy(true);
492-
this.tilingTexture = null;
491+
if (this.tilingTexture)
492+
{
493+
this.tilingTexture.destroy(true);
494+
this.tilingTexture = null;
495+
}
493496

494497
};

0 commit comments

Comments
 (0)