Bug 719896 - Remove unnecessary gInitialized in nsParserModule.cpp; r=bsmedberg

This commit is contained in:
Ms2ger 2012-02-01 11:54:21 +01:00
Родитель c4992ad023
Коммит d6b8921df6
1 изменённых файлов: 15 добавлений и 23 удалений

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

@ -98,26 +98,21 @@ static const mozilla::Module::ContractIDEntry kParserContracts[] = {
{ NULL }
};
static bool gInitialized = false;
static nsresult
Initialize()
{
if (!gInitialized) {
nsresult rv = nsHTMLTags::AddRefTable();
NS_ENSURE_SUCCESS(rv, rv);
nsresult rv = nsHTMLTags::AddRefTable();
NS_ENSURE_SUCCESS(rv, rv);
rv = nsHTMLEntities::AddRefTable();
if (NS_FAILED(rv)) {
nsHTMLTags::ReleaseTable();
return rv;
}
#ifdef NS_DEBUG
CheckElementTable();
#endif
CNewlineToken::AllocNewline();
gInitialized = true;
rv = nsHTMLEntities::AddRefTable();
if (NS_FAILED(rv)) {
nsHTMLTags::ReleaseTable();
return rv;
}
#ifdef NS_DEBUG
CheckElementTable();
#endif
CNewlineToken::AllocNewline();
#ifdef DEBUG
nsHTMLTags::TestTagTable();
@ -129,14 +124,11 @@ Initialize()
static void
Shutdown()
{
if (gInitialized) {
nsHTMLTags::ReleaseTable();
nsHTMLEntities::ReleaseTable();
nsDTDContext::ReleaseGlobalObjects();
nsParser::Shutdown();
CNewlineToken::FreeNewline();
gInitialized = false;
}
nsHTMLTags::ReleaseTable();
nsHTMLEntities::ReleaseTable();
nsDTDContext::ReleaseGlobalObjects();
nsParser::Shutdown();
CNewlineToken::FreeNewline();
}
static mozilla::Module kParserModule = {