Commit a31a9e1b authored by StefanBruens's avatar StefanBruens

SplashPath: Add move constructor

After moving, the new SplashPath is in the same state as it
has been copy constructed, the moved from is in the same
state as default constructed, i.e. empty.
parent 2190b999
......@@ -72,6 +72,23 @@ SplashPath::SplashPath(SplashPath *path) {
}
}
SplashPath::SplashPath(SplashPath&& path) {
length = path.length;
size = path.size;
pts = path.pts;
flags = path.flags;
curSubpath = path.curSubpath;
hints = path.hints;
hintsLength = hintsSize = path.hintsLength;
path.pts = nullptr;
path.flags = nullptr;
path.length = path.size = 0;
path.hints = nullptr;
path.hintsLength = path.hintsSize = 0;
}
SplashPath::~SplashPath() {
gfree(pts);
gfree(flags);
......
......@@ -79,6 +79,7 @@ public:
SplashPath(const SplashPath&) = delete;
SplashPath& operator=(const SplashPath&) = delete;
SplashPath(SplashPath&& path);
// Append <path> to <this>.
void append(SplashPath *path);
......
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