mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 22:55:23 +00:00
Checked in patch for bug 243804:
Observer isn't unregistered when window closes
This commit is contained in:
parent
78037b10c0
commit
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user