Bug 419096 - "getPathSegAtLength() causes nsSVGPathSegMovetoAbs to leak" [p=longsonr@gmail.com (Robert Longson) r+sr=roc a1.9=damons]

This commit is contained in:
reed@reedloden.com 2008-02-26 01:51:31 -08:00
parent 37e0037e5e
commit 2224f1eaa4

View File

@ -151,9 +151,9 @@ nsSVGPathElement::GetPathSegAtLength(float distance, PRUint32 *_retval)
// because if distance is longer than the total length of the path we return
// the index of the final segment anyway.
while (distCovered < distance && i < numSegments - 1) {
nsIDOMSVGPathSeg *iSeg;
mSegments->GetItem(i, &iSeg);
nsSVGPathSeg* curSeg = static_cast<nsSVGPathSeg*>(iSeg);
nsCOMPtr<nsIDOMSVGPathSeg> segment;
mSegments->GetItem(i, getter_AddRefs(segment));
nsSVGPathSeg* curSeg = static_cast<nsSVGPathSeg*>(segment.get());
if (i == 0) {
curSeg->GetLength(&ts);
} else {