Fix for unitialized var and missing add/release ref pair in the GetScriptGlobalObject call
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user