Bug 1012386 - Release the CGImage we addref'd in DrawTargetCG::CopySurface. r=jrmuizel, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 21 May 2014 18:43:16 +1200
changeset 200360 4652cf70d98f0826d24df65e9068ee0d80e4d3a2
parent 200359 875e084aa158828075918e46c5ffac9af576e7d0
child 200361 ff93da121a5fdad259a8c87fc926856aebbb2ebb
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, sledru
bugs1012386
milestone31.0a2
Bug 1012386 - Release the CGImage we addref'd in DrawTargetCG::CopySurface. r=jrmuizel, a=sledru
gfx/2d/DrawTargetCG.cpp
--- a/gfx/2d/DrawTargetCG.cpp
+++ b/gfx/2d/DrawTargetCG.cpp
@@ -1248,16 +1248,17 @@ DrawTargetCG::CopySurface(SourceSurface 
     // Quartz seems to copy A8 surfaces incorrectly if we don't initialize them
     // to transparent first.
     if (mFormat == SurfaceFormat::A8) {
       CGContextClearRect(mCg, flippedRect);
     }
     CGContextDrawImage(mCg, flippedRect, image);
 
     CGContextRestoreGState(mCg);
+    CGImageRelease(image);
   }
 }
 
 void
 DrawTargetCG::DrawSurfaceWithShadow(SourceSurface *aSurface, const Point &aDest, const Color &aColor, const Point &aOffset, Float aSigma, CompositionOp aOperator)
 {
   MarkChanged();