From b6a812544198d8fb637945c929e258d6eb887473 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Wed, 1 Aug 2018 16:59:30 -0400 Subject: [PATCH] fix: dispose event listeners on window correctly (#119) --- 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')) {