Skip to content

Commit

Permalink
fix: dispose event listeners on window correctly (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored Aug 1, 2018
1 parent faa7d9a commit b6a8125
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ class VR extends Plugin {
this.effect.dispose();
}

window.removeEventListener('resize', this.handleResize_);
window.removeEventListener('vrdisplaypresentchange', this.handleResize_);
window.removeEventListener('vrdisplayactivate', this.handleVrDisplayActivate_);
window.removeEventListener('vrdisplaydeactivate', this.handleVrDisplayDeactivate_);
window.removeEventListener('resize', this.handleResize_, true);
window.removeEventListener('vrdisplaypresentchange', this.handleResize_, true);
window.removeEventListener('vrdisplayactivate', this.handleVrDisplayActivate_, true);
window.removeEventListener('vrdisplaydeactivate', this.handleVrDisplayDeactivate_, true);

// re-add the big play button to player
if (!this.player_.getChild('BigPlayButton')) {
Expand Down

0 comments on commit b6a8125

Please sign in to comment.