Hold a ref to the binding we're tearing down so it doesn't die before we're

done with it.  Bug 292717, r+sr=jst, a=shaver
This commit is contained in:
bzbarsky%mit.edu 2005-06-01 19:27:43 +00:00
parent 2b42e0aac2
commit 2f4d64c7dc

View File

@ -640,7 +640,8 @@ nsBindingManager::AddLayeredBinding(nsIContent* aContent, nsIURI* aURL)
NS_IMETHODIMP
nsBindingManager::RemoveLayeredBinding(nsIContent* aContent, nsIURI* aURL)
{
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) {
return NS_OK;