Closed Bug 1438055 Opened 2 years ago Closed 2 years ago

Switch Fluent Localization class to use weak observers

Categories

(Core :: Internationalization, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

Details

Attachments

(1 file)

In bug 1437427 we discovered something that may or may not be a leak, but one of the things that fix it is a switch to weak reference observers.

Since it's easy and seems to be universally better, let's do this.
Assignee: nobody → gandalf
Blocks: 1437427
Status: NEW → ASSIGNED
Priority: -- → P3
I confirm that with this patch, the patch in bug 1437427 does not fail the test anymore
Comment on attachment 8950811 [details]
Bug 1438055 - Switch Fluent Localization class to use weak observers.

https://reviewboard.mozilla.org/r/220058/#review226266

::: intl/l10n/Localization.jsm:263
(Diff revision 2)
> -   * Unregister observers on events that will trigger cache invalidation
> -   */
> -  unregisterObservers() {
> -    ObserverService.removeObserver(this, 'l10n:available-locales-changed');
> -    ObserverService.removeObserver(this, 'intl:requested-locales-changed');
>    }

I think we should keep doing this, in the event that the window leaks through some other means we don't want to keep updating it.
Attachment #8950811 - Flags: review?(dtownsend) → review-
Comment on attachment 8950811 [details]
Bug 1438055 - Switch Fluent Localization class to use weak observers.

https://reviewboard.mozilla.org/r/220058/#review226292
Attachment #8950811 - Flags: review?(dtownsend) → review+
Pushed by zbraniecki@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/790328190453
Switch Fluent Localization class to use weak observers. r=mossop
https://hg.mozilla.org/mozilla-central/rev/790328190453
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.