Checked in patch for bug 243804:

Observer isn't unregistered when window closes
This commit is contained in:
mostafah%oeone.com 2004-08-30 13:56:37 +00:00
Родитель 78037b10c0
Коммит b8c2eec906
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -42,6 +42,7 @@ function calendarPrefObserver( CalendarPreferences )
try {
var pbi = rootPrefNode.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
pbi.addObserver("calendar", this, false);
window.addEventListener("unload", this, false);
} catch(ex) {
dump("Calendar: Failed to observe prefs: " + ex + "\n");
}
@ -95,6 +96,12 @@ calendarPrefObserver.prototype =
//this causes Mozilla to freeze
//firePendingEvents();
},
handleEvent: function handleEvent(event)
{
var pbi = rootPrefNode.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
pbi.removeObserver(this.domain, this);
}
}