зеркало из https://github.com/mozilla/pjs.git
Bug 391992. nsMathMLOperator statics leak. r=bzbarsky, sr=rbs, a=dbaron
This commit is contained in:
Родитель
bc4c353ba1
Коммит
8b7b9ca2cb
|
@ -382,27 +382,32 @@ InitGlobals()
|
|||
rv = InitOperators();
|
||||
}
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
if (gInvariantCharArray) {
|
||||
delete gInvariantCharArray;
|
||||
gInvariantCharArray = nsnull;
|
||||
}
|
||||
if (gOperatorArray) {
|
||||
delete[] gOperatorArray;
|
||||
gOperatorArray = nsnull;
|
||||
}
|
||||
if (gStretchyOperatorArray) {
|
||||
delete gStretchyOperatorArray;
|
||||
gStretchyOperatorArray = nsnull;
|
||||
}
|
||||
if (gOperatorTable) {
|
||||
delete gOperatorTable;
|
||||
gOperatorTable = nsnull;
|
||||
}
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
nsMathMLOperators::CleanUp();
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
nsMathMLOperators::CleanUp()
|
||||
{
|
||||
if (gInvariantCharArray) {
|
||||
delete gInvariantCharArray;
|
||||
gInvariantCharArray = nsnull;
|
||||
}
|
||||
if (gOperatorArray) {
|
||||
delete[] gOperatorArray;
|
||||
gOperatorArray = nsnull;
|
||||
}
|
||||
if (gStretchyOperatorArray) {
|
||||
delete gStretchyOperatorArray;
|
||||
gStretchyOperatorArray = nsnull;
|
||||
}
|
||||
if (gOperatorTable) {
|
||||
delete gOperatorTable;
|
||||
gOperatorTable = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsMathMLOperators::AddRefTable(void)
|
||||
{
|
||||
|
@ -413,18 +418,7 @@ void
|
|||
nsMathMLOperators::ReleaseTable(void)
|
||||
{
|
||||
if (0 == --gTableRefCount) {
|
||||
if (gOperatorArray) {
|
||||
delete[] gOperatorArray;
|
||||
gOperatorArray = nsnull;
|
||||
}
|
||||
if (gStretchyOperatorArray) {
|
||||
delete gStretchyOperatorArray;
|
||||
gStretchyOperatorArray = nsnull;
|
||||
}
|
||||
if (gOperatorTable) {
|
||||
delete gOperatorTable;
|
||||
gOperatorTable = nsnull;
|
||||
}
|
||||
CleanUp();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ class nsMathMLOperators {
|
|||
public:
|
||||
static void AddRefTable(void);
|
||||
static void ReleaseTable(void);
|
||||
static void CleanUp();
|
||||
|
||||
// LookupOperator:
|
||||
// Given the string value of an operator and its form (last two bits of flags),
|
||||
|
|
Загрузка…
Ссылка в новой задаче