зеркало из https://github.com/mozilla/gecko-dev.git
Bug 654182, svgnumberlist keeps a strong pointer to element, r=dholbert
This commit is contained in:
Родитель
bf59741c06
Коммит
a0c9b6dfaf
|
@ -179,15 +179,16 @@ public:
|
|||
{}
|
||||
|
||||
SVGNumberListAndInfo(nsSVGElement *aElement)
|
||||
: mElement(aElement)
|
||||
: mElement(do_GetWeakReference(static_cast<nsINode*>(aElement)))
|
||||
{}
|
||||
|
||||
void SetInfo(nsSVGElement *aElement) {
|
||||
mElement = aElement;
|
||||
mElement = do_GetWeakReference(static_cast<nsINode*>(aElement));
|
||||
}
|
||||
|
||||
nsSVGElement* Element() const {
|
||||
return mElement; // .get();
|
||||
nsCOMPtr<nsIContent> e = do_QueryReferent(mElement);
|
||||
return static_cast<nsSVGElement*>(e.get());
|
||||
}
|
||||
|
||||
nsresult CopyFrom(const SVGNumberListAndInfo& rhs) {
|
||||
|
@ -218,10 +219,11 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
// We must keep a strong reference to our element because we may belong to a
|
||||
// We must keep a weak reference to our element because we may belong to a
|
||||
// cached baseVal nsSMILValue. See the comments starting at:
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=515116#c15
|
||||
nsRefPtr<nsSVGElement> mElement;
|
||||
// See also https://bugzilla.mozilla.org/show_bug.cgi?id=653497
|
||||
nsWeakPtr mElement;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче