зеркало из https://github.com/mozilla/gecko-dev.git
Fix for unitialized var and missing add/release ref pair in the GetScriptGlobalObject call
This commit is contained in:
Родитель
98a6e7f5d1
Коммит
0b8640b954
|
@ -208,6 +208,9 @@ nsWebShell::nsWebShell()
|
|||
{
|
||||
NS_INIT_REFCNT();
|
||||
mHistoryIndex = -1;
|
||||
|
||||
mScriptGlobal = nsnull;
|
||||
mScriptContext = nsnull;
|
||||
}
|
||||
|
||||
nsWebShell::~nsWebShell()
|
||||
|
@ -222,6 +225,9 @@ nsWebShell::~nsWebShell()
|
|||
NS_IF_RELEASE(mContainer);
|
||||
NS_IF_RELEASE(mObserver);
|
||||
|
||||
NS_IF_RELEASE(mScriptGlobal);
|
||||
NS_IF_RELEASE(mScriptContext);
|
||||
|
||||
// Release references on our children
|
||||
ReleaseChildren();
|
||||
|
||||
|
@ -1070,7 +1076,9 @@ nsWebShell::GetScriptGlobalObject(nsIScriptGlobalObject** aGlobal)
|
|||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
*aGlobal = mScriptGlobal;
|
||||
NS_ADDREF(mScriptGlobal);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -208,6 +208,9 @@ nsWebShell::nsWebShell()
|
|||
{
|
||||
NS_INIT_REFCNT();
|
||||
mHistoryIndex = -1;
|
||||
|
||||
mScriptGlobal = nsnull;
|
||||
mScriptContext = nsnull;
|
||||
}
|
||||
|
||||
nsWebShell::~nsWebShell()
|
||||
|
@ -222,6 +225,9 @@ nsWebShell::~nsWebShell()
|
|||
NS_IF_RELEASE(mContainer);
|
||||
NS_IF_RELEASE(mObserver);
|
||||
|
||||
NS_IF_RELEASE(mScriptGlobal);
|
||||
NS_IF_RELEASE(mScriptContext);
|
||||
|
||||
// Release references on our children
|
||||
ReleaseChildren();
|
||||
|
||||
|
@ -1070,7 +1076,9 @@ nsWebShell::GetScriptGlobalObject(nsIScriptGlobalObject** aGlobal)
|
|||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
*aGlobal = mScriptGlobal;
|
||||
NS_ADDREF(mScriptGlobal);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче