summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Edgington <alec.m.edgington@gmail.com>2018-06-14 21:03:14 +0100
committerAlec Edgington <alec.m.edgington@gmail.com>2018-06-14 21:21:30 +0100
commitaf78948c8c9d64685f3d62a501c50b89550ee098 (patch)
tree2952e46e95c05766e0d483a9a157c275a0d03df0
parent7c767ca994ac59a83cc4911ec450f6606cbc60c9 (diff)
downloadlibhidl-af78948c8c9d64685f3d62a501c50b89550ee098.tar.gz
Don't call the destructor on the base class.
Not only is this unnecessary (since the base-class destructor is called automatically), but it is probably undefined behaviour, as it leads to the base-class destructor being called twice. Although clang doesn't complain about this, gcc gives a compilation error (albeit with a highly confusing message). Test: No compilation error from gcc. Change-Id: I5043630335d0b09b08d4272794f292ed98541b87 Signed-off-by: Alec Edgington <alec.m.edgington@gmail.com>
-rw-r--r--base/HidlSupport.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index a69faa2..eb4368f 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -315,9 +315,7 @@ HidlMemory::HidlMemory(const hidl_string& name, hidl_handle&& handle, size_t siz
: hidl_memory(name, std::move(handle), size) {}
// it's required to have at least one out-of-line method to avoid weak vtable
-HidlMemory::~HidlMemory() {
- hidl_memory::~hidl_memory();
-}
+HidlMemory::~HidlMemory() {}
} // namespace hardware
} // namespace android