Add move constructor/assignment operator to hidl_memory
Bug: 34093434
Test: hidl_test passes
Change-Id: I6bb7e2e3c914040daa8d72d9a86a5a3d3f8338e5
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index 2abdf1b..37f40c4 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -265,11 +265,12 @@
void hidl_string::moveFrom(hidl_string &&other) {
// assume my resources are freed.
- mBuffer = other.mBuffer;
+ mBuffer = std::move(other.mBuffer);
mSize = other.mSize;
mOwnsBuffer = other.mOwnsBuffer;
other.mOwnsBuffer = false;
+ other.clear();
}
void hidl_string::clear() {