Fix for bug 297311 (consistent crash when trying to call xmlDocument.replaceChild(newChild, xmlDocument.documentElement) on XML document rendered in a frame). r/sr=bz, a=asa.

git-svn-id: svn://10.0.0.236/trunk@174560 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2005-06-14 12:30:17 +00:00
parent 44f2a51000
commit a22cce94f5

View File

@@ -415,7 +415,9 @@ nsBindingManager::ChangeDocumentFor(nsIContent* aContent, nsIDocument* aOldDocum
if (! aOldDocument)
return NS_ERROR_NULL_POINTER;
nsXBLBinding *binding = nsBindingManager::GetBinding(aContent);
// Hold a ref to the binding so it won't die when we remove it from our
// table.
nsRefPtr<nsXBLBinding> binding = nsBindingManager::GetBinding(aContent);
if (binding) {
binding->ChangeDocument(aOldDocument, aNewDocument);
SetBinding(aContent, nsnull);