mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 14:30:43 +00:00
Bug 578696 part 10. Stop holding strong refs when calling ContentInserted. r=sicking
This commit is contained in:
parent
e3b2e5a289
commit
3e398f4206
@ -234,6 +234,12 @@ public:
|
||||
* aDocument
|
||||
* @param aChild The newly inserted child.
|
||||
* @param aIndexInContainer The index in the container of the new child.
|
||||
*
|
||||
* @note Callers of this method might not hold a strong reference to the
|
||||
* observer. The observer is responsible for making sure it stays
|
||||
* alive for the duration of the call as needed. The observer may
|
||||
* assume that this call will happen when there are script blockers on
|
||||
* the stack.
|
||||
*/
|
||||
virtual void ContentInserted(nsIDocument *aDocument,
|
||||
nsIContent* aContainer,
|
||||
|
@ -183,7 +183,7 @@ nsNodeUtils::ContentInserted(nsINode* aContainer,
|
||||
document = static_cast<nsIDocument*>(aContainer);
|
||||
}
|
||||
|
||||
IMPL_STRONGREF_MUTATION_NOTIFICATION(ContentInserted, aContainer,
|
||||
IMPL_MUTATION_NOTIFICATION(ContentInserted, aContainer,
|
||||
(document, container, aChild, aIndexInContainer));
|
||||
}
|
||||
|
||||
|
@ -1121,6 +1121,9 @@ nsXULDocument::ContentInserted(nsIDocument* aDocument,
|
||||
{
|
||||
NS_ASSERTION(aDocument == this, "unexpected doc");
|
||||
|
||||
// Might not need this, but be safe for now.
|
||||
nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
|
||||
|
||||
AddSubtreeToDocument(aChild);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user