Title: [156099] trunk/Source/WebCore
Revision
156099
Author
[email protected]
Date
2013-09-19 09:00:36 -0700 (Thu, 19 Sep 2013)

Log Message

REGRESSION (r149928): CanvasStyle::operator= leaks everything
https://bugs.webkit.org/show_bug.cgi?id=121591

Reviewed by Andreas Kling.

* html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::operator=): Don't leak.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156098 => 156099)


--- trunk/Source/WebCore/ChangeLog	2013-09-19 15:11:52 UTC (rev 156098)
+++ trunk/Source/WebCore/ChangeLog	2013-09-19 16:00:36 UTC (rev 156099)
@@ -1,3 +1,12 @@
+2013-09-19  Alexey Proskuryakov  <[email protected]>
+
+        REGRESSION (r149928): CanvasStyle::operator= leaks everything
+        https://bugs.webkit.org/show_bug.cgi?id=121591
+
+        Reviewed by Andreas Kling.
+
+        * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::operator=): Don't leak.
+
 2013-09-19  Andrei Parvu  <[email protected]>
 
         [CSS Masking/Background] Position property should be ignored when using repeat: space

Modified: trunk/Source/WebCore/html/canvas/CanvasStyle.cpp (156098 => 156099)


--- trunk/Source/WebCore/html/canvas/CanvasStyle.cpp	2013-09-19 15:11:52 UTC (rev 156098)
+++ trunk/Source/WebCore/html/canvas/CanvasStyle.cpp	2013-09-19 16:00:36 UTC (rev 156099)
@@ -238,13 +238,8 @@
 CanvasStyle& CanvasStyle::operator=(const CanvasStyle& other)
 {
     if (this != &other) {
-        memcpy(this, &other, sizeof(CanvasStyle));
-        if (m_type == Gradient)
-            m_gradient->ref();
-        else if (m_type == ImagePattern)
-            m_pattern->ref();
-        else if (m_type == CMYKA)
-            m_cmyka = new CMYKAValues(other.m_cmyka->rgba, other.m_cmyka->c, other.m_cmyka->m, other.m_cmyka->y, other.m_cmyka->k, other.m_cmyka->a);
+        this->~CanvasStyle();
+        new (this) CanvasStyle(other);
     }
     return *this;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to