Bug 235204, remove pref observer to avoid a crash (bug 306135), r=mano

This commit is contained in:
gavin%gavinsharp.com 2005-09-05 22:30:08 +00:00
Родитель 8cccf41469
Коммит cd1adf1b4a
3 изменённых файлов: 4 добавлений и 26 удалений

Просмотреть файл

@ -113,7 +113,6 @@
// there may not be anything to remove here
try {
this.controllers.removeController(this.searchbarController);
this.mPrefObserver.unregister();
} catch (ex) { }
]]></destructor>
@ -140,7 +139,6 @@
.getService(Components.interfaces.nsIPrefBranch2);
this._initializeEngine();
this.mPrefObserver.register();
var element;
element = document.createElementNS(XUL_NS, "menuseparator");
@ -184,25 +182,6 @@
<field name="rdfService"/>
<field name="internetSearchDS"/>
<field name="formHistSvc"/>
<field name="mPrefObserver" readonly="true"><![CDATA[
({
mOuter: this,
register: function() {
this.mOuter.prefService.addObserver("browser.search.selectedEngine", this, false);
},
unregister: function() {
this.mOuter.prefService.removeObserver("browser.search.selectedEngine", this);
},
observe: function(aSubject, aTopic, aData) {
if (aTopic == "nsPref:changed")
this.mOuter._initializeEngine();
}
});
]]></field>
<method name="openSearch">
<body>
@ -264,7 +243,6 @@
// because the searchbar isn't currently destroyed when
// removed from the toolbar
if (!this.parentNode) {
this.mPrefObserver.unregister();
return false;
}

Просмотреть файл

@ -1,5 +1,5 @@
/* ***** BEGIN LICENSE BLOCK *****
#if 0
%if 0
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -33,7 +33,7 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
#endif
%endif
* ***** END LICENSE BLOCK ***** */
#searchEngineList {

Просмотреть файл

@ -41,7 +41,7 @@ var gDialog = {};
var gSelectedEngineIndex;
const kTabPref = "browser.tabs.opentabfor.searchdialog";
const kEnginePref = "browser.search.selectedEngine";
const kEnginePref = "browser.search.selectedEngineInDialog";
const kDefEnginePref = "browser.search.defaultenginename";
const nsIPLS = Components.interfaces.nsIPrefLocalizedString;
const kXUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";