OSDN Git Service

Bug2857086 - memory leak in FontCustomPlatformData.
authorclaireho <chinglanho@gmail.com>
Fri, 20 Aug 2010 18:11:14 +0000 (11:11 -0700)
committerclaireho <chinglanho@gmail.com>
Fri, 20 Aug 2010 18:15:57 +0000 (11:15 -0700)
The change can also fix Chrome issue32353 - need to patch
to Chrome.

Change-Id: I08df08f2316156e78e9b63415e9c8720ab193090

WebCore/platform/graphics/android/FontCustomPlatformData.cpp

index fbce1fa..90a9f41 100644 (file)
@@ -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());