summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-04 14:53:56 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-04 14:53:56 +0000
commitd409e1de8df58f0e5780cef9fa5c738a4984fc37 (patch)
tree1aee9a1d69e9b51d30a060346248c12f5d28f590 /skia
parent166dfbbe59d85acac3e15aa6792634d6b2dab43a (diff)
downloadchromium_src-d409e1de8df58f0e5780cef9fa5c738a4984fc37.zip
chromium_src-d409e1de8df58f0e5780cef9fa5c738a4984fc37.tar.gz
chromium_src-d409e1de8df58f0e5780cef9fa5c738a4984fc37.tar.bz2
mac: Fix a few memory leaks.
All found by clang's static analyzer. BUG=none Review URL: https://codereview.chromium.org/12390058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/skia_utils_mac.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm
index c0db013..f181f0a 100644
--- a/skia/ext/skia_utils_mac.mm
+++ b/skia/ext/skia_utils_mac.mm
@@ -363,8 +363,10 @@ CGContextRef SkiaBitLocker::cgContext() {
bitmap_.allocPixels();
bitmap_.eraseColor(0);
}
+ base::mac::ScopedCFTypeRef<CGColorSpaceRef> colorSpace(
+ CGColorSpaceCreateDeviceRGB());
cgContext_ = CGBitmapContextCreate(bitmap_.getPixels(), bitmap_.width(),
- bitmap_.height(), 8, bitmap_.rowBytes(), CGColorSpaceCreateDeviceRGB(),
+ bitmap_.height(), 8, bitmap_.rowBytes(), colorSpace,
kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst);
// Apply device matrix.