Bug 1533846 - Clear WeakMap entries for Messaging System notifications r=k88hudson

Differential Revision: https://phabricator.services.mozilla.com/D40432

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrei Oprea 2019-08-05 08:50:22 +00:00
parent 577c3ffca3
commit 2255219c63

View File

@ -51,7 +51,7 @@ ChromeUtils.defineModuleGetter(
// Frequency at which to check for new messages
const SYSTEM_TICK_INTERVAL = 5 * 60 * 1000;
const notificationsByWindow = new WeakMap();
let notificationsByWindow = new WeakMap();
class _ToolbarBadgeHub {
constructor() {
@ -213,6 +213,7 @@ class _ToolbarBadgeHub {
}
this._clearBadgeTimeout();
this.state = {};
notificationsByWindow = new WeakMap();
}
removeToolbarNotification(toolbarButton) {
@ -337,6 +338,7 @@ class _ToolbarBadgeHub {
this._clearBadgeTimeout();
clearInterval(this.state._intervalId);
this.state = null;
notificationsByWindow = new WeakMap();
Services.prefs.removeObserver(this.prefs.WHATSNEW_TOOLBAR_PANEL, this);
}
}