зеркало из https://github.com/mozilla/gecko-dev.git
Checked in patch for bug 243804:
Observer isn't unregistered when window closes
This commit is contained in:
Родитель
78037b10c0
Коммит
b8c2eec906
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче