Delete Texture only applicable on render.gl

There is no deleteTexture on this.renderer when running on canvas.
 Destroying tilesprite (scene shutting down) would throw error.
This commit is contained in:
José Maria 2018-04-16 21:50:04 -03:00 committed by GitHub
parent 1eff0b2889
commit 607ce3a9bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -274,7 +274,7 @@ var TileSprite = new Class({
*/ */
destroy: function () destroy: function ()
{ {
if (this.renderer) if (this.renderer.gl)
{ {
this.renderer.deleteTexture(this.tileTexture); this.renderer.deleteTexture(this.tileTexture);
} }