From 22947c16fa41d148b91d8e563f0f7e27b4e2772e Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Wed, 1 Aug 2018 16:54:08 -0400 Subject: [PATCH] fix: dispose event listeners on window correctly --- src/plugin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 3f10f62b..7448382e 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -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')) {