https://bugs.webkit.org/show_bug.cgi?id=121591
Reviewed by Andreas Kling.
* html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::operator=): Don't leak.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156099
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-09-19 Alexey Proskuryakov <ap@apple.com>
+
+ 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 <parvu@adobe.com>
[CSS Masking/Background] Position property should be ignored when using repeat: space
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;
}