From 25c2cc29cfdd5e0c438bd5387f338d72ba446a5f 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: Fix memory leak when creating SkBitmapProcShader A SkShader is ref counted, but the first but unref() was never called for the local reference in PlatformGraphicsContextSkia::drawBitmapPattern(). Change-Id: Ia1936d62f052f9440ef0316cc642b0aebd79cfe1 --- .../platform/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 fcd9ade..915970b 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp @@ -238,7 +238,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); -- cgit v1.1