From: claireho Date: Fri, 20 Aug 2010 18:11:14 +0000 (-0700) Subject: Bug2857086 - memory leak in FontCustomPlatformData. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a8cbb273facae4b7fc5c44de730b2068d59ebde7;p=android-x86%2Fexternal-webkit.git Bug2857086 - memory leak in FontCustomPlatformData. The change can also fix Chrome issue32353 - need to patch to Chrome. Change-Id: I08df08f2316156e78e9b63415e9c8720ab193090 --- diff --git a/WebCore/platform/graphics/android/FontCustomPlatformData.cpp b/WebCore/platform/graphics/android/FontCustomPlatformData.cpp index fbce1fac8..90a9f41ac 100644 --- a/WebCore/platform/graphics/android/FontCustomPlatformData.cpp +++ b/WebCore/platform/graphics/android/FontCustomPlatformData.cpp @@ -64,6 +64,8 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer) // make a copy of it. SkStream* stream = new SkMemoryStream(buffer->data(), buffer->size(), true); SkTypeface* face = SkTypeface::CreateFromStream(stream); + // Release the stream. + stream->unref(); if (0 == face) { SkDebugf("--------- SkTypeface::CreateFromBuffer failed %d\n", buffer->size());