From 858ec39f3f4218ac427d54419e8a5a1153de4dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Roux?= Date: Thu, 20 Apr 2017 17:19:39 +0200 Subject: [PATCH] Destroy the displayObject of the HotspotMaterial properly (#53) Patch for video materials --- src/hotspots/HotspotMaterial.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspots/HotspotMaterial.js b/src/hotspots/HotspotMaterial.js index 7121f3a4..29afb4ce 100644 --- a/src/hotspots/HotspotMaterial.js +++ b/src/hotspots/HotspotMaterial.js @@ -89,7 +89,7 @@ FORGE.HotspotMaterial = function(viewer, hotspotUid) /** * The display object used for the texture * @name FORGE.HotspotMaterial#_displayObject - * @type {(FORGE.Image|FORGE.DisplayObject)} + * @type {FORGE.DisplayObject} * @private */ this._displayObject = null; @@ -658,11 +658,11 @@ FORGE.HotspotMaterial.prototype.destroy = function() this._material = null; } - if(this._type === FORGE.HotspotMaterial.types.IMAGE && this._displayObject !== null) + if(this._displayObject !== null) { this._displayObject.destroy(); + this._displayObject = null; } - this._displayObject = null; if(this._onReady !== null) {