diff --git a/content/xbl/src/nsBindingManager.cpp b/content/xbl/src/nsBindingManager.cpp index d6a40d30f767..c86f4173dcb0 100644 --- a/content/xbl/src/nsBindingManager.cpp +++ b/content/xbl/src/nsBindingManager.cpp @@ -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 binding = nsBindingManager::GetBinding(aContent); if (!binding) { return NS_OK;