Bug 474056 - Minor fixes for undefind variables r=dao

This commit is contained in:
Rob Arnold 2009-10-06 15:09:49 -04:00
parent 2970e95de0
commit c4f71f1e57

View File

@ -393,15 +393,15 @@ TabWindow.prototype = {
destroy: function () {
let tabs = this.tabbrowser.mTabs;
for (let i = 0; i < tabs.length; i++)
this.removeTab(tabs[i]);
for each (let evtName in this.events)
this.tabbrowser.tabContainer.removeEventListener(evtName, this, false);
let idx = AeroPeek.windows.indexOf(win.gTaskbarTabGroup);
for (let i = 0; i < tabs.length; i++)
this.removeTab(tabs[i], true);
let idx = AeroPeek.windows.indexOf(this.win.gTaskbarTabGroup);
AeroPeek.windows.splice(idx, 1);
AeroPeek.checkPreviewCount();
for each (let evtName in this.events)
this.tabbrowser.tabcontainer.removeEventListener(evtName, this, false);
},
get width () {
@ -427,15 +427,17 @@ TabWindow.prototype = {
},
// Invoked when the given tab is closed
removeTab: function (tab) {
removeTab: function (tab, dontSplice) {
let preview = this.previewFromTab(tab);
preview.active = false;
preview.visible = false;
preview.move(null);
preview.controller.wrappedJSObject.destroy();
this.previews.splice(tab._tPos, 1);
// We don't want to splice from the array if the tabs aren't being removed
// from the tab bar as well (as is the case when the window closes).
if (!dontSplice)
this.previews.splice(tab._tPos, 1);
AeroPeek.removePreview(preview);
},