From c1d893e99bec0b49fea78ca11bc0529474c2991a Mon Sep 17 00:00:00 2001 From: Yury Date: Thu, 15 Nov 2012 20:34:57 -0500 Subject: [PATCH] Bug 812039 - mozIsPointInPath leaks CGPath objects. r=jmuizelaar --- gfx/2d/PathCG.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gfx/2d/PathCG.cpp b/gfx/2d/PathCG.cpp index 8dfc29439d63..191a4039b8aa 100644 --- a/gfx/2d/PathCG.cpp +++ b/gfx/2d/PathCG.cpp @@ -222,8 +222,10 @@ PathCG::StrokeContainsPoint(const StrokeOptions &aStrokeOptions, CGContextRestoreGState(cg); CGPathRef sPath = CGContextCopyPath(cg); + bool inStroke = CGPathContainsPoint(sPath, nullptr, point, false); + CGPathRelease(sPath); - return CGPathContainsPoint(sPath, nullptr, point, false); + return inStroke; } //XXX: what should these functions return for an empty path?