Skip to content

Commit

Permalink
Disposing the atomNode's dragListener, see #115
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Mar 18, 2020
1 parent 4bb4059 commit e24cb96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/common/view/BAMScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ class BAMScreenView extends ScreenView {
* @private
*/
onAtomRemovedFromPlayArea( atom ) {

// Remove mapped atom node from the view and dispose it.
this.kitPlayAreaNode.atomLayer.removeChild( this.kitPlayAreaNode.atomNodeMap[ atom.id ] );
this.kitPlayAreaNode.atomNodeMap[ atom.id ].dispose();
const atomNode = this.kitPlayAreaNode.atomNodeMap[ atom.id ];
atomNode.dragListener.dispose();
atomNode.dispose();

delete this.kitPlayAreaNode.atomNodeMap[ atom.id ];
}
}
Expand Down

0 comments on commit e24cb96

Please sign in to comment.