Bug 499608. Fix leak of nsSVGRenderingObserverList frame property. r=jwatt

--HG--
extra : rebase_source : 46c93829cd467ca651df225003586d84043e173d
This commit is contained in:
Robert O'Callahan 2009-06-24 20:47:21 +12:00
parent 001a8ce4ef
commit 67b25a2f2a

View File

@ -426,6 +426,15 @@ GetObserverList(nsIFrame *aFrame)
return static_cast<nsSVGRenderingObserverList*>(aFrame->GetProperty(nsGkAtoms::observer));
}
static void
DeleteObserverList(void *aObject,
nsIAtom *aPropertyName,
void *aPropertyValue,
void *aData)
{
delete static_cast<nsSVGRenderingObserverList*>(aPropertyValue);
}
void
nsSVGEffects::AddRenderingObserver(nsIFrame *aFrame, nsSVGRenderingObserver *aObserver)
{
@ -439,7 +448,7 @@ nsSVGEffects::AddRenderingObserver(nsIFrame *aFrame, nsSVGRenderingObserver *aOb
for (nsIFrame* f = aFrame; f; f = f->GetNextContinuation()) {
f->AddStateBits(NS_FRAME_MAY_BE_TRANSFORMED_OR_HAVE_RENDERING_OBSERVERS);
}
aFrame->SetProperty(nsGkAtoms::observer, observerList);
aFrame->SetProperty(nsGkAtoms::observer, observerList, DeleteObserverList);
}
observerList->Add(aObserver);
}