зеркало из https://github.com/mozilla/pjs.git
Bug 20309. Use nsCAutoString. Kudos to buhr@stat.wisc.edu
This commit is contained in:
Родитель
2900b68958
Коммит
3b8299d2ed
|
@ -1600,16 +1600,7 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
|
||||||
if (NS_OK == owner->GetScriptContext(getter_AddRefs(context))) {
|
if (NS_OK == owner->GetScriptContext(getter_AddRefs(context))) {
|
||||||
nsAutoString tag;
|
nsAutoString tag;
|
||||||
Tag()->ToString(tag);
|
Tag()->ToString(tag);
|
||||||
|
context->AddNamedReference((void*) &mScriptObject, mScriptObject, nsCAutoString(tag));
|
||||||
char buf[64];
|
|
||||||
char* p = buf;
|
|
||||||
if (tag.Length() >= PRInt32(sizeof buf))
|
|
||||||
p = (char *)nsAllocator::Alloc(tag.Length() + 1);
|
|
||||||
|
|
||||||
context->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
|
||||||
|
|
||||||
if (p != buf)
|
|
||||||
nsCRT::free(p);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1600,16 +1600,7 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep)
|
||||||
if (NS_OK == owner->GetScriptContext(getter_AddRefs(context))) {
|
if (NS_OK == owner->GetScriptContext(getter_AddRefs(context))) {
|
||||||
nsAutoString tag;
|
nsAutoString tag;
|
||||||
Tag()->ToString(tag);
|
Tag()->ToString(tag);
|
||||||
|
context->AddNamedReference((void*) &mScriptObject, mScriptObject, nsCAutoString(tag));
|
||||||
char buf[64];
|
|
||||||
char* p = buf;
|
|
||||||
if (tag.Length() >= PRInt32(sizeof buf))
|
|
||||||
p = (char *)nsAllocator::Alloc(tag.Length() + 1);
|
|
||||||
|
|
||||||
context->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
|
||||||
|
|
||||||
if (p != buf)
|
|
||||||
nsCRT::free(p);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче