Skip to content

Commit

Permalink
manually dispose KeyboardHelpSectionRows, phetsims/scenery-phet#769
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Apr 4, 2023
1 parent 3852406 commit daeab1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion js/quadrilateral/view/MoveShapeHelpSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export default class MoveShapeHelpSection extends KeyboardHelpSection {
}
);

super( moveCornersOrSidesStringProperty, [ basicMovementRow, fineMovementRow ] );
const rows = [ basicMovementRow, fineMovementRow ];
super( moveCornersOrSidesStringProperty, rows );
this.disposeEmitter.addListener( () => rows.forEach( row => row.dispose() ) );

}
}

Expand Down
3 changes: 2 additions & 1 deletion js/quadrilateral/view/ShapeShortcutsHelpSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ export default class ShapeShortcutsHelpSection extends KeyboardHelpSection {
}
);

const contents = [];
const contents: KeyboardHelpSectionRow[] = [];
if ( voicingManager.initialized ) {
contents.push( checkShapeRow );
}
contents.push( resetShapeRow );

super( QuadrilateralStrings.keyboardHelpDialog.shapeShortcutsStringProperty, contents );
this.disposeEmitter.addListener( () => contents.forEach( row => row.dispose() ) );
}
}

Expand Down

0 comments on commit daeab1d

Please sign in to comment.