Skip to content

Commit

Permalink
Merge pull request #711 from 3DStreet/helper-dispose
Browse files Browse the repository at this point in the history
Dispose helper when removing it
  • Loading branch information
kfarr authored Jul 16, 2024
2 parents 3f19531 + 0db4a24 commit 0c0bdb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Inspector.prototype = {
let helper;

if (object instanceof THREE.Camera) {
this.cameraHelper = helper = new THREE.CameraHelper(object, 0.1);
this.cameraHelper = helper = new THREE.CameraHelper(object);
} else if (object instanceof THREE.PointLight) {
helper = new THREE.PointLightHelper(object, 1);
} else if (object instanceof THREE.DirectionalLight) {
Expand Down Expand Up @@ -144,6 +144,7 @@ Inspector.prototype = {
const helper = this.helpers[node.uuid];
if (helper) {
this.sceneHelpers.remove(helper);
helper.dispose();
delete this.helpers[node.uuid];
Events.emit('helperremove', this.helpers[node.uuid]);
}
Expand Down

0 comments on commit 0c0bdb0

Please sign in to comment.