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

This commit is contained in:
joki@netscape.com
1998-07-25 01:53:54 +00:00
parent fca5c1b845
commit 028d254b4b
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;
}