Fix for bug 405639 (Dynamically created <svg:use> reference loop causes nsGenericElement leak). r/sr/a=sicking.

This commit is contained in:
peterv@propagandism.org 2007-11-30 10:41:10 -08:00
parent 13f58b61a9
commit ef6dd036da
2 changed files with 14 additions and 1 deletions

View File

@ -62,10 +62,22 @@ NS_IMPL_NS_NEW_SVG_ELEMENT(Use)
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_CYCLE_COLLECTION_CLASS(nsSVGUseElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsSVGUseElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOriginal)
tmp->DestroyAnonymousContent();
tmp->RemoveListener();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsSVGUseElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOriginal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mClone)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mSourceContent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsSVGUseElement,nsSVGUseElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGUseElement,nsSVGUseElementBase)
NS_INTERFACE_MAP_BEGIN(nsSVGUseElement)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsSVGUseElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
NS_INTERFACE_MAP_ENTRY(nsIDOMElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGElement)

View File

@ -76,6 +76,7 @@ public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsSVGUseElement, nsSVGUseElementBase)
NS_DECL_NSIDOMSVGUSEELEMENT
NS_DECL_NSIDOMSVGURIREFERENCE