diff options
author | Alexey Proskuryakov <ap@apple.com> | 2013-10-14 12:11:23 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-14 20:56:57 +0200 |
commit | 4354f29ee16b127667b4481e55dc415739f5f342 (patch) | |
tree | 34206cf6771a63af3855f9356e86da0454f32173 /Source/WebCore | |
parent | 23e9d9d082358e61ffed57550ec43eadc991a9dc (diff) |
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.
Change-Id: I422e07ff97b04c3cd57fdfc437ae12b56ddfedf7
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/html/canvas/CanvasStyle.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Source/WebCore/html/canvas/CanvasStyle.cpp b/Source/WebCore/html/canvas/CanvasStyle.cpp index 5fa11987b..ea9001b4f 100644 --- a/Source/WebCore/html/canvas/CanvasStyle.cpp +++ b/Source/WebCore/html/canvas/CanvasStyle.cpp @@ -238,13 +238,8 @@ CanvasStyle::CanvasStyle(const CanvasStyle& other) 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; } |