Bug 812039 - mozIsPointInPath leaks CGPath objects. r=jmuizelaar
authorYury <async.processingjs@yahoo.com>
Thu, 15 Nov 2012 20:34:57 -0500
changeset 113457 90c362bfd15651c04d4fda407876ec83e943d6d0
parent 113456 3a7e4882559f65937f1423b7f297f6f3a7924461
child 113458 cc66f9bb15891a7218b3f2687ac0c059d33ed792
push id18158
push userryanvm@gmail.com
push dateFri, 16 Nov 2012 01:34:59 +0000
treeherdermozilla-inbound@90c362bfd156 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar
bugs812039
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 812039 - mozIsPointInPath leaks CGPath objects. r=jmuizelaar
gfx/2d/PathCG.cpp
--- a/gfx/2d/PathCG.cpp
+++ b/gfx/2d/PathCG.cpp
@@ -217,18 +217,20 @@ PathCG::StrokeContainsPoint(const Stroke
   CGContextAddPath(cg, mPath);
 
   SetStrokeOptions(cg, aStrokeOptions);
 
   CGContextReplacePathWithStrokedPath(cg);
   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?
 // currently they return CGRectNull {inf,inf, 0, 0}
 Rect
 PathCG::GetBounds(const Matrix &aTransform) const
 {
   //XXX: are these bounds tight enough