Bug 1062832 - Use nsRefPtr in the filter references array instead of manual refcounting. r=roc

This commit is contained in:
Markus Stange 2014-09-09 17:14:45 +02:00
parent f245bd4c4e
commit f06f1f5f0f
2 changed files with 3 additions and 11 deletions

View File

@ -223,20 +223,12 @@ nsSVGFilterProperty::nsSVGFilterProperty(const nsTArray<nsStyleFilter> &aFilters
if (aFilters[i].GetType() != NS_STYLE_FILTER_URL)
continue;
nsSVGFilterReference *reference =
nsRefPtr<nsSVGFilterReference> reference =
new nsSVGFilterReference(aFilters[i].GetURL(), aFilteredFrame);
NS_ADDREF(reference);
mReferences.AppendElement(reference);
}
}
nsSVGFilterProperty::~nsSVGFilterProperty()
{
for (uint32_t i = 0; i < mReferences.Length(); i++) {
NS_RELEASE(mReferences[i]);
}
}
bool
nsSVGFilterProperty::ReferencesValidResources()
{

View File

@ -214,10 +214,10 @@ public:
NS_DECL_ISUPPORTS
protected:
virtual ~nsSVGFilterProperty();
virtual ~nsSVGFilterProperty() {}
private:
nsTArray<nsSVGFilterReference*> mReferences;
nsTArray<nsRefPtr<nsSVGFilterReference>> mReferences;
};
class nsSVGMarkerProperty : public nsSVGIDRenderingObserver {