From 607ce3a9bb0bf79311e208aec3bb1c121ecfebde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Maria?= Date: Mon, 16 Apr 2018 21:50:04 -0300 Subject: [PATCH] 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. --- src/gameobjects/tilesprite/TileSprite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gameobjects/tilesprite/TileSprite.js b/src/gameobjects/tilesprite/TileSprite.js index c6e3b4982..daf52430b 100644 --- a/src/gameobjects/tilesprite/TileSprite.js +++ b/src/gameobjects/tilesprite/TileSprite.js @@ -274,7 +274,7 @@ var TileSprite = new Class({ */ destroy: function () { - if (this.renderer) + if (this.renderer.gl) { this.renderer.deleteTexture(this.tileTexture); }