Skip to content

Commit

Permalink
TransformControls: Fix dispose(). (#29512)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Sep 27, 2024
1 parent 5b0e281 commit 6cff00a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,7 @@ class TransformControls extends Controls {

this.disconnect();

this.traverse( function ( child ) {

if ( child.geometry ) child.geometry.dispose();
if ( child.material ) child.material.dispose();

} );
this._root.dispose();

}

Expand Down Expand Up @@ -811,6 +806,17 @@ class TransformControlsRoot extends Object3D {

}

dispose() {

this.traverse( function ( child ) {

if ( child.geometry ) child.geometry.dispose();
if ( child.material ) child.material.dispose();

} );

}

}

class TransformControlsGizmo extends Object3D {
Expand Down

0 comments on commit 6cff00a

Please sign in to comment.