Closed Bug 1358543 Opened 8 years ago Closed 8 years ago

New XPCLocaleCallbacks created on each call to xpc_LocalizeContext

Categories

(Core :: JavaScript: Internationalization API, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

Details

Attachments

(1 file)

In bug 1349401 we made JSContext's locale stay up to date with LocaleService changes. Unfortunately, what I conveniently missed is that the very first line of xpc_LocalizeContext is creating a new XPCLocaleCallbacks on each call. :smaug suspects that this is only visible in tests after my patch for bug 1348042 as leaks in asan build here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9944f5530c4c&selectedJob=93241436
Assignee: nobody → gandalf
Blocks: 1348042
Status: NEW → ASSIGNED
Attachment #8860468 - Flags: review?(bugs)
Comment on attachment 8860468 [details] Bug 1358543 - Only set new locale callbacks in xpc_LocalizeContext if they're not set. https://reviewboard.mozilla.org/r/132464/#review135342 ::: js/xpconnect/src/XPCLocale.cpp:244 (Diff revision 2) > + // We want to assign the locale callbacks only the first time we > + // localize the context. > + // All consequent calls to this function are result of language changes > + // and should not assign it again. > + const JSLocaleCallbacks* lc = JS_GetLocaleCallbacks(cx); > + if (lc == nullptr) { if (!lc) {
Attachment #8860468 - Flags: review?(bugs) → review+
Pushed by zbraniecki@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8cc3f9c8d5d Only set new locale callbacks in xpc_LocalizeContext if they're not set. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: