Skip to content

Commit

Permalink
better dispose (bug fix), phetsims/density-buoyancy-common#364
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed Aug 29, 2024
1 parent 725e706 commit 10b5c11
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions js/accessibility/GrabDragInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,15 +663,8 @@ export default class GrabDragInteraction extends EnabledComponent {
}
}

if ( voicingNode.interactiveHighlightLayerable ) {
const highlightParent = this.grabInteractiveHighlight.parent!;
assert && assert( highlightParent, 'how can we have interactiveHighlightLayerable with a ' +
'node that is not in the scene graph?' );

if ( highlightParent.hasChild( this.dragInteractiveHighlight ) ) {
highlightParent.removeChild( this.dragInteractiveHighlight );
}
}
// to support cases of interactiveHighlightLayerable
this.dragInteractiveHighlight.detach();

releasedUtterance.dispose();
this.voicingFocusUtterance.dispose();
Expand All @@ -680,7 +673,7 @@ export default class GrabDragInteraction extends EnabledComponent {
this.ownsGrabFocusHighlight && this.grabFocusHighlight.dispose();
this.ownsGrabInteractiveHighlight && this.grabInteractiveHighlight.dispose();
this.grabCueNode.dispose();
this.dragCueNode && ( this.dragFocusHighlight.focusHighlight as HighlightPath ).removeChild( this.dragCueNode );
this.dragCueNode && this.dragCueNode.detach();
};
}

Expand Down

0 comments on commit 10b5c11

Please sign in to comment.