From 803acb13f0a85ea9b5048c429ae21d02d64b2f5a Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 12 Sep 2017 08:15:22 +0800 Subject: [PATCH] fix move-ctor and move-assignement operator of graphics(#253) --- source/paint/graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/paint/graphics.cpp b/source/paint/graphics.cpp index b7dd3426..c617b3ee 100644 --- a/source/paint/graphics.cpp +++ b/source/paint/graphics.cpp @@ -240,12 +240,16 @@ namespace paint graphics::graphics(graphics&& other) : impl_(std::move(other.impl_)) { + other.impl_.reset(new implementation); } graphics& graphics::operator=(graphics&& other) { if (this != &other) + { impl_ = std::move(other.impl_); + other.impl_.reset(new implementation); + } return *this; }