Bug 614995 - Assertion in the browser-chrome suite due to BrowserOffline.uninit trying to remove its observers even if it hasn't registered them (ASSERTION: Oops! You're asking for a weak reference to an object that doesn't support that.: 'factoryPtr'); r,a=gavin

This commit is contained in:
Ehsan Akhgari 2010-11-26 15:24:51 -05:00
Родитель 2afb1bc46b
Коммит 5e23097cf3
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -5446,6 +5446,8 @@ function setStyleDisabled(disabled) {
/* End of the Page Style functions */
var BrowserOffline = {
_inited: false,
/////////////////////////////////////////////////////////////////////////////
// BrowserOffline Public Methods
init: function ()
@ -5456,13 +5458,14 @@ var BrowserOffline = {
Services.obs.addObserver(this, "network:offline-status-changed", false);
this._updateOfflineUI(Services.io.offline);
this._inited = true;
},
uninit: function ()
{
try {
if (this._inited) {
Services.obs.removeObserver(this, "network:offline-status-changed");
} catch (ex) {
}
},