Commit b1d7cf20 authored by dominikg@chromium.org's avatar dominikg@chromium.org

Fix memory leak in GraphicsContextState.

In GraphicsContextState::copy we use placement-new to overwrite the current
object. We need to first call the object's destructor though to not leak any
memory.

BUG=383548

Review URL: https://codereview.chromium.org/335613002

git-svn-id: svn://svn.chromium.org/blink/trunk@176106 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 38c53095
...@@ -59,6 +59,7 @@ GraphicsContextState::GraphicsContextState(const GraphicsContextState& other) ...@@ -59,6 +59,7 @@ GraphicsContextState::GraphicsContextState(const GraphicsContextState& other)
void GraphicsContextState::copy(const GraphicsContextState& source) void GraphicsContextState::copy(const GraphicsContextState& source)
{ {
this->~GraphicsContextState();
new (this) GraphicsContextState(source); new (this) GraphicsContextState(source);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment