зеркало из https://github.com/mozilla/pjs.git
Add shouldBeFreed calls for nsJSContext. b=394566 r+sr=peterv a=bzbarsky
This commit is contained in:
Родитель
781a22bce6
Коммит
4c0456f65a
|
@ -618,6 +618,9 @@ nsGlobalWindow::CleanUp()
|
|||
|
||||
mOpener = nsnull; // Forces Release
|
||||
if (mContext) {
|
||||
#ifdef DEBUG
|
||||
nsCycleCollector_DEBUG_shouldBeFreed(mContext);
|
||||
#endif
|
||||
mContext = nsnull; // Forces Release
|
||||
}
|
||||
mChromeEventHandler = nsnull; // Forces Release
|
||||
|
@ -1818,10 +1821,11 @@ nsGlobalWindow::SetDocShell(nsIDocShell* aDocShell)
|
|||
mScriptContexts[st_ndx] = nsnull;
|
||||
}
|
||||
}
|
||||
mContext = nsnull; // we nuked it above also
|
||||
#ifdef DEBUG
|
||||
nsCycleCollector_DEBUG_shouldBeFreed(mContext);
|
||||
nsCycleCollector_DEBUG_shouldBeFreed(static_cast<nsIScriptGlobalObject*>(this));
|
||||
#endif
|
||||
mContext = nsnull; // we nuked it above also
|
||||
}
|
||||
|
||||
mDocShell = aDocShell; // Weak Reference
|
||||
|
|
|
@ -996,6 +996,9 @@ nsJSContext::nsJSContext(JSRuntime *aRuntime) : mGCOnDestruction(PR_TRUE)
|
|||
|
||||
nsJSContext::~nsJSContext()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
nsCycleCollector_DEBUG_wasFreed(static_cast<nsIScriptContext*>(this));
|
||||
#endif
|
||||
NS_PRECONDITION(!mTerminations, "Shouldn't have termination funcs by now");
|
||||
|
||||
// Cope with JS_NewContext failure in ctor (XXXbe move NewContext to Init?)
|
||||
|
|
Загрузка…
Ссылка в новой задаче