From b2e091a5ffd9e2c395084b2c0bb09a35645af3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Isaksson?= Date: Mon, 29 Oct 2012 14:13:36 +0100 Subject: [PATCH] DO NOT MERGE Fix memory leak when creating SkBitmapProcShader cherry pick from AOSP/master A SkShader is ref counted, but the first but unref() was never called for the local reference in PlatformGraphicsContextSkia::drawBitmapPattern(). Change-Id: I2d1a2e95eeaf479e332a2dbd4e1e9f1b8baac0f7 --- .../graphics/android/context/PlatformGraphicsContextSkia.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp index cd3ef7da1..b9fc2f5cb 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp @@ -239,7 +239,7 @@ void PlatformGraphicsContextSkia::drawBitmapPattern( SkPaint paint; setupPaintCommon(&paint); paint.setAlpha(getNormalizedAlpha()); - paint.setShader(shader); + paint.setShader(shader)->unref(); paint.setXfermodeMode(WebCoreCompositeToSkiaComposite(compositeOp)); fixPaintForBitmapsThatMaySeam(&paint); mCanvas->drawRect(destRect, paint);