Bug 787236 - Correctly remove "pagehide" listener when exiting Reader (r=mfinkle)

This commit is contained in:
Lucas Rocha 2012-08-31 16:36:37 +01:00
parent fa30605428
commit ffb440fb73

View File

@ -2689,10 +2689,12 @@ Tab.prototype = {
if (/^about:reader/.test(target.documentURI)) { if (/^about:reader/.test(target.documentURI)) {
let aboutReader = new AboutReader(this.browser.contentDocument, this.browser.contentWindow); let aboutReader = new AboutReader(this.browser.contentDocument, this.browser.contentWindow);
this.browser.addEventListener("pagehide", function listener() { let listener = function() {
aboutReader.uninit(); aboutReader.uninit();
this.browser.removeEventListener("pagehide", listener, true); this.browser.removeEventListener("pagehide", listener, true);
}.bind(this), true); }.bind(this);
this.browser.addEventListener("pagehide", listener, true);
} }
break; break;
} }