[tbb-commits] [tor-browser/tor-browser-31.2.0esr-4.5-1] Revert "fixup! Bug #5926: Allow customization of content JS locale."
mikeperry at torproject.org
mikeperry at torproject.org
Thu Oct 30 20:48:36 UTC 2014
commit e007a57d358f1165feb5f8506b4efe5be46224cb
Author: Mike Perry <mikeperry-git at torproject.org>
Date: Thu Oct 30 13:31:11 2014 -0700
Revert "fixup! Bug #5926: Allow customization of content JS locale."
This reverts commit eb0ccdb7ffc70ffa4b4a60100606261882d68129.
I missed that the JS engine was managing its own copy of the returned string.
We do need to strdup it.
---
xpcom/build/nsXPComInit.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp
index 62f31bf..979e10b 100644
--- a/xpcom/build/nsXPComInit.cpp
+++ b/xpcom/build/nsXPComInit.cpp
@@ -493,7 +493,7 @@ void StartWatchingDefaultLocalePref() {
// Store the default JavaScript locale.
JSRuntime* rt = GetRuntime();
if (rt) {
- sJSLocale = JS_GetDefaultLocale(rt);
+ sJSLocale = strdup(JS_GetDefaultLocale(rt));
}
// Now keep the locale updated with the current pref value.
mozilla::Preferences::RegisterCallbackAndCall(DefaultLocaleChangedCallback, DEFAULT_LOCALE_PREF);
More information about the tbb-commits
mailing list