Title: [120826] trunk/Source/WebCore
Revision
120826
Author
[email protected]
Date
2012-06-20 09:07:34 -0700 (Wed, 20 Jun 2012)

Log Message

[Cairo] Fix memory leak in GraphicsContext3DCairo.cpp
https://bugs.webkit.org/show_bug.cgi?id=89561

Patch by Sudarsana Nagineni <[email protected]> on 2012-06-20
Reviewed by Martin Robinson.

Fix a memory leak in GraphicsContext3D::getImageData().

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::getImageData): asNewNativeImage() returns a
caller-owned pointer to the native image data. So, using OwnPtr to manage
memory automatically.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120825 => 120826)


--- trunk/Source/WebCore/ChangeLog	2012-06-20 16:06:02 UTC (rev 120825)
+++ trunk/Source/WebCore/ChangeLog	2012-06-20 16:07:34 UTC (rev 120826)
@@ -1,3 +1,17 @@
+2012-06-20  Sudarsana Nagineni  <[email protected]>
+
+        [Cairo] Fix memory leak in GraphicsContext3DCairo.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=89561
+
+        Reviewed by Martin Robinson.
+
+        Fix a memory leak in GraphicsContext3D::getImageData().
+
+        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
+        (WebCore::GraphicsContext3D::getImageData): asNewNativeImage() returns a
+        caller-owned pointer to the native image data. So, using OwnPtr to manage
+        memory automatically.
+
 2012-06-20  Allan Sandfeld Jensen  <[email protected]>
 
         Use HitTestPoint instead of LayoutPoint for nodeAtPoint.

Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp (120825 => 120826)


--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp	2012-06-20 16:06:02 UTC (rev 120825)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp	2012-06-20 16:07:34 UTC (rev 120826)
@@ -159,7 +159,8 @@
         decoder.setData(image->data(), true);
         if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndex(0))
             return false;
-        imageSurface = decoder.createFrameAtIndex(0)->surface();
+        OwnPtr<NativeImageCairo> nativeImage = adoptPtr(decoder.createFrameAtIndex(0));
+        imageSurface = nativeImage->surface();
     } else {
         imageSurface = image->nativeImageForCurrentFrame()->surface();
         if (!premultiplyAlpha)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to