Fix for unitialized var and missing add/release ref pair in the GetScriptGlobalObject call

git-svn-id: svn://10.0.0.236/trunk@6476 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
joki%netscape.com
1998-07-25 01:53:54 +00:00
parent 30a68f1ef5
commit f59e41e644
2 changed files with 16 additions and 0 deletions

View File

@@ -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;
}