mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1729642 - patch 1 - Make shutdown of nsLanguageAtomService explicit instead of relying on ClearOnShutdown. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125587
This commit is contained in:
parent
005ecf476c
commit
da9c992100
@ -80,16 +80,19 @@ static constexpr struct {
|
||||
{"Thai", nsGkAtoms::th},
|
||||
{"Tibt", nsGkAtoms::x_tibt}};
|
||||
|
||||
static UniquePtr<nsLanguageAtomService> gLangAtomService;
|
||||
|
||||
// static
|
||||
nsLanguageAtomService* nsLanguageAtomService::GetService() {
|
||||
static UniquePtr<nsLanguageAtomService> gLangAtomService;
|
||||
if (!gLangAtomService) {
|
||||
gLangAtomService = MakeUnique<nsLanguageAtomService>();
|
||||
ClearOnShutdown(&gLangAtomService);
|
||||
}
|
||||
return gLangAtomService.get();
|
||||
}
|
||||
|
||||
// static
|
||||
void nsLanguageAtomService::Shutdown() { gLangAtomService = nullptr; }
|
||||
|
||||
nsStaticAtom* nsLanguageAtomService::LookupLanguage(
|
||||
const nsACString& aLanguage) {
|
||||
nsAutoCString lowered(aLanguage);
|
||||
|
@ -28,6 +28,8 @@ class nsLanguageAtomService final {
|
||||
public:
|
||||
static nsLanguageAtomService* GetService();
|
||||
|
||||
static void Shutdown();
|
||||
|
||||
nsStaticAtom* LookupLanguage(const nsACString& aLanguage);
|
||||
already_AddRefed<nsAtom> LookupCharSet(NotNull<const Encoding*> aCharSet);
|
||||
nsAtom* GetLocaleLanguage();
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "mozilla/dom/HTMLDNSPrefetch.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/dom/SVGElementFactory.h"
|
||||
#include "nsLanguageAtomService.h"
|
||||
#include "nsMathMLAtoms.h"
|
||||
#include "nsMathMLOperators.h"
|
||||
#include "Navigator.h"
|
||||
@ -319,6 +320,7 @@ void nsLayoutStatics::Shutdown() {
|
||||
HTMLDNSPrefetch::Shutdown();
|
||||
nsCSSRendering::Shutdown();
|
||||
StaticPresData::Shutdown();
|
||||
nsLanguageAtomService::Shutdown();
|
||||
#ifdef DEBUG
|
||||
nsIFrame::DisplayReflowShutdown();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user