[Qt] Leak with GraphicsContext::takeOwnershipOfPlatformContext()
authorreni@webkit.org <reni@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Nov 2010 13:40:11 +0000 (13:40 +0000)
committerreni@webkit.org <reni@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Nov 2010 13:40:11 +0000 (13:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=49916

Reviewed by Andreas Kling.

Change the order of calling QPainter::device() and QPainter::end(), so device() will return with a valid device.
No new test is needed.

* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@72907 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/qt/GraphicsContextQt.cpp

index 5da7786..0c912b0 100644 (file)
@@ -1,3 +1,16 @@
+2010-11-30  Renata Hodovan  <reni@inf.u-szeged.hu>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Leak with GraphicsContext::takeOwnershipOfPlatformContext()
+        https://bugs.webkit.org/show_bug.cgi?id=49916
+
+        Change the order of calling QPainter::device() and QPainter::end(), so device() will return with a valid device.
+        No new test is needed.
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
+
 2010-11-30  Patrick Gansterer  <paroga@webkit.org>
 
         Reviewed by Andreas Kling.
index eafbc15..86dabe1 100644 (file)
@@ -258,8 +258,8 @@ GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate()
     if (!platformContextIsOwned)
         return;
 
-    painter->end();
     QPaintDevice* device = painter->device();
+    painter->end();
     delete painter;
     delete device;
 }