Bug 1012386 - Release the CGImage we addref'd in DrawTargetCG::CopySurface. r=jrmuizel
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 21 May 2014 18:43:16 +1200
changeset 184075 6b57eca751f8ea2b5bb1162c99ec2085e4816c14
parent 184074 90b98c0ef8153726f6ece0a4c056ba2e94987034
child 184076 6c446b233036afc69b6590133328a117edbfbd8a
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1012386
milestone32.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 1012386 - Release the CGImage we addref'd in DrawTargetCG::CopySurface. r=jrmuizel
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();