fix for 19133. r=waterson, a=brendan.

This commit is contained in:
dougt%netscape.com 1999-12-09 02:28:43 +00:00
parent 91c22f9f57
commit b854d078d4
2 changed files with 8 additions and 4 deletions

View File

@ -1681,7 +1681,8 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
mDocument->GetScriptGlobalObject(getter_AddRefs(global));
if (global) {
nsCOMPtr<nsIScriptContext> context;
if (NS_OK == global->GetContext(getter_AddRefs(context))) {
global->GetContext(getter_AddRefs(context));
if (context) {
context->RemoveReference((void*) &mScriptObject, mScriptObject);
}
}
@ -1697,7 +1698,8 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
mDocument->GetScriptGlobalObject(getter_AddRefs(global));
if (global) {
nsCOMPtr<nsIScriptContext> context;
if (NS_OK == global->GetContext(getter_AddRefs(context))) {
global->GetContext(getter_AddRefs(context));
if (context) {
context->AddNamedReference((void*) &mScriptObject, mScriptObject, "nsXULElement::mScriptObject");
}
}

View File

@ -1681,7 +1681,8 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
mDocument->GetScriptGlobalObject(getter_AddRefs(global));
if (global) {
nsCOMPtr<nsIScriptContext> context;
if (NS_OK == global->GetContext(getter_AddRefs(context))) {
global->GetContext(getter_AddRefs(context));
if (context) {
context->RemoveReference((void*) &mScriptObject, mScriptObject);
}
}
@ -1697,7 +1698,8 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
mDocument->GetScriptGlobalObject(getter_AddRefs(global));
if (global) {
nsCOMPtr<nsIScriptContext> context;
if (NS_OK == global->GetContext(getter_AddRefs(context))) {
global->GetContext(getter_AddRefs(context));
if (context) {
context->AddNamedReference((void*) &mScriptObject, mScriptObject, "nsXULElement::mScriptObject");
}
}