Skip to content

Commit

Permalink
Destroy the displayObject of the HotspotMaterial properly (#53)
Browse files Browse the repository at this point in the history
Patch for video materials
  • Loading branch information
rroux-gpsw authored and benjamin committed Apr 20, 2017
1 parent 9565d55 commit 858ec39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hotspots/HotspotMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 858ec39

Please # to comment.