Bug 846186 - Tilt error flooding error console (TypeError: mouseLerp is undefined), r=rcampbell

This commit is contained in:
Victor Porof 2013-03-01 11:49:19 +02:00
parent 634a19638b
commit a9a9729e97

View File

@ -1127,7 +1127,11 @@ TiltVisualizer.Presenter.prototype = {
TiltUtils.destroyObject(this._renderer);
this.contentWindow.removeEventListener("resize", this._onResize, false);
// Closing the tab would result in contentWindow being a dead object,
// so operations like removing event listeners won't work anymore.
if (this.contentWindow == this.chromeWindow.content) {
this.contentWindow.removeEventListener("resize", this._onResize, false);
}
}
};
@ -1232,7 +1236,11 @@ TiltVisualizer.Controller.prototype = {
canvas.removeEventListener("keypress", this._onKeyPress, true);
canvas.removeEventListener("blur", this._onBlur, false);
presenter.contentWindow.removeEventListener("resize", this._onResize, false);
// Closing the tab would result in contentWindow being a dead object,
// so operations like removing event listeners won't work anymore.
if (presenter.contentWindow == presenter.chromeWindow.content) {
presenter.contentWindow.removeEventListener("resize", this._onResize, false);
}
},
/**