mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 933699 - TabView.uninit() leaks the TabView window r=gijs
From eb90c41f6a6d3f1b2d9d4dcbfa1bb32de497c597 Mon Sep 17 00:00:00 2001
This commit is contained in:
parent
abb2cad8d6
commit
2fdb29e9ea
@ -151,6 +151,15 @@ let TabView = {
|
||||
"SSWindowStateReady", this._SSWindowStateReadyListener, false);
|
||||
|
||||
this._initialized = false;
|
||||
|
||||
if (this._window) {
|
||||
this._window = null;
|
||||
}
|
||||
|
||||
if (this._iframe) {
|
||||
this._iframe.remove();
|
||||
this._iframe = null;
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
@ -253,10 +262,9 @@ let TabView = {
|
||||
|
||||
// ----------
|
||||
hide: function TabView_hide() {
|
||||
if (!this.isVisible())
|
||||
return;
|
||||
|
||||
this._window.UI.exit();
|
||||
if (this.isVisible() && this._window) {
|
||||
this._window.UI.exit();
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
@ -804,6 +804,8 @@ let TabItems = {
|
||||
AllTabs.unregister(name, this._eventListeners[name]);
|
||||
}
|
||||
this.items.forEach(function(tabItem) {
|
||||
delete tabItem.tab._tabViewTabItem;
|
||||
|
||||
for (let x in tabItem) {
|
||||
if (typeof tabItem[x] == "object")
|
||||
tabItem[x] = null;
|
||||
|
@ -214,7 +214,7 @@ let UI = {
|
||||
});
|
||||
|
||||
// ___ setup event listener to save canvas images
|
||||
gWindow.addEventListener("SSWindowClosing", function onWindowClosing() {
|
||||
let onWindowClosing = function () {
|
||||
gWindow.removeEventListener("SSWindowClosing", onWindowClosing, false);
|
||||
|
||||
// XXX bug #635975 - don't unlink the tab if the dom window is closing.
|
||||
@ -226,7 +226,12 @@ let UI = {
|
||||
TabItems.saveAll();
|
||||
|
||||
self._save();
|
||||
}, false);
|
||||
};
|
||||
|
||||
gWindow.addEventListener("SSWindowClosing", onWindowClosing);
|
||||
this._cleanupFunctions.push(function () {
|
||||
gWindow.removeEventListener("SSWindowClosing", onWindowClosing);
|
||||
});
|
||||
|
||||
// ___ load frame script
|
||||
let frameScript = "chrome://browser/content/tabview-content.js";
|
||||
|
Loading…
Reference in New Issue
Block a user