Skip to content

Commit

Permalink
fix(core): check if Mesh.material is an array in OBBHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Crejak authored and zarov committed Jul 9, 2019
1 parent ddc820e commit 69536f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utils/debug/OBBHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ class OBBHelper extends THREE.LineSegments {
this.material.dispose();
this.geometry.dispose();
if (this.textMesh) {
this.textMesh.material.dispose();
if (Array.isArray(this.textMesh.material)) {
for (const material of this.textMesh.material) {
material.dispose();
}
} else {
this.textMesh.material.dispose();
}
this.textMesh.geometry.dispose();
delete this.textMesh;
}
Expand Down

0 comments on commit 69536f4

Please sign in to comment.