Bug 1729642 - patch 2 - Make nsContentUtils hold a strong reference to the nsNameSpaceManager. r=emilio

Depends on D125587

Differential Revision: https://phabricator.services.mozilla.com/D125588
This commit is contained in:
Jonathan Kew 2021-09-14 18:51:50 +00:00
Родитель da9c992100
Коммит 944bcb1ace
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -737,6 +737,7 @@ nsresult nsContentUtils::Init() {
sNameSpaceManager = nsNameSpaceManager::GetInstance();
NS_ENSURE_TRUE(sNameSpaceManager, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(sNameSpaceManager);
sXPConnect = nsXPConnect::XPConnect();
// We hold a strong ref to sXPConnect to ensure that it does not go away until
@ -1873,6 +1874,7 @@ void nsContentUtils::Shutdown() {
NS_IF_RELEASE(sNullSubjectPrincipal);
NS_IF_RELEASE(sIOService);
NS_IF_RELEASE(sUUIDGenerator);
NS_IF_RELEASE(sNameSpaceManager);
sLineBreaker = nullptr;
sWordBreaker = nullptr;
sBidiKeyboard = nullptr;