Bug 433231 - Places Library leaks the nsGlobalWindow when closed with a history entry selected, r=dietrich

This commit is contained in:
Marco Bonardo
2009-01-13 11:48:28 +01:00
parent a38786817f
commit a72d9234f6
2 changed files with 12 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ var gEditItemOverlay = {
_hiddenRows: [],
_observersAdded: false,
_staticFoldersListBuilt: false,
_initialized: false;
get itemId() {
return this._itemId;
@@ -123,6 +124,11 @@ var gEditItemOverlay = {
* read-only (view) mode even if the given item is editable.
*/
initPanel: function EIO_initPanel(aFor, aInfo) {
// For sanity ensure that the implementer has uninited the panel before
// trying to init it again, or we could end up leaking due to observers.
if (this._initialized)
this.uninitPanel(false);
var aItemIdList;
if (aFor.length) {
aItemIdList = aFor;
@@ -218,6 +224,7 @@ var gEditItemOverlay = {
// tags selector
this._rebuildTagsSelectorList();
this._initialized = true;
}
// name picker
@@ -541,6 +548,7 @@ var gEditItemOverlay = {
this._allTags = [];
this._itemIds = [];
this._multiEdit = false;
this._initialized = false;
},
onTagsFieldBlur: function EIO_onTagsFieldBlur() {

View File

@@ -665,7 +665,10 @@ var PlacesOrganizer = {
detailsDeck.selectedIndex == 1 && !gEditItemOverlay.multiEdit)
return;
}
// Clean up the panel before initing it again.
gEditItemOverlay.uninitPanel(false);
if (aSelectedNode && !PlacesUtils.nodeIsSeparator(aSelectedNode)) {
detailsDeck.selectedIndex = 1;
// Using the concrete itemId is arguably wrong. The bookmarks API