Navigation Menu

Skip to content

Commit

Permalink
[embedlite-components] Cleanup / fix window close chrome event handle…
Browse files Browse the repository at this point in the history
…rs code
  • Loading branch information
rainemak committed Jun 30, 2016
1 parent a72513c commit 5f71dbf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jscomps/EmbedLiteOrientationChangeHandler.js
Expand Up @@ -53,7 +53,10 @@ EmbedLiteOrientationChangeHandler.prototype = {
},

onWindowClosed: function(aWindow) {
Services.embedlite.chromeEventHandler(aWindow).addEventListener("DOMContentLoaded", this._orientationListeners[aWindow], false);
let chromeEventHandler = Services.embedlite.chromeEventHandler(aWindow);
if (chromeEventHandler) {
chromeEventHandler.removeEventListener("DOMContentLoaded", this._orientationListeners[aWindow], false);
}
delete this._orientationListeners[aWindow];
},

Expand Down

0 comments on commit 5f71dbf

Please sign in to comment.