From 5afb0d4f7bb873797fcca32c0b86f3689f720d73 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Tue, 26 Feb 2008 01:51:31 -0800 Subject: [PATCH] Bug 419096 - "getPathSegAtLength() causes nsSVGPathSegMovetoAbs to leak" [p=longsonr@gmail.com (Robert Longson) r+sr=roc a1.9=damons] --- content/svg/content/src/nsSVGPathElement.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/svg/content/src/nsSVGPathElement.cpp b/content/svg/content/src/nsSVGPathElement.cpp index 9ae8cdb2429..06ee1f2a290 100644 --- a/content/svg/content/src/nsSVGPathElement.cpp +++ b/content/svg/content/src/nsSVGPathElement.cpp @@ -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(iSeg); + nsCOMPtr segment; + mSegments->GetItem(i, getter_AddRefs(segment)); + nsSVGPathSeg* curSeg = static_cast(segment.get()); if (i == 0) { curSeg->GetLength(&ts); } else {