diff options
author | Brian Silverman <bsilver16384@gmail.com> | 2015-06-16 16:56:48 -0700 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2015-06-16 19:58:56 -0700 |
commit | c4069d2d37b67296d675c2d1de42a46dc6d43efc (patch) | |
tree | 623663557077c18952f3b1ffdc072f52cd1c3178 | |
parent | 019362fefcdca39a46d1a831ed46266c24b9a273 (diff) | |
download | gperftools-c4069d2d37b67296d675c2d1de42a46dc6d43efc.tar.gz |
Add empty virtual destructor to class with virtual methods.
Clang 3.5 has a warning about deleting objects with virtual methods
through non-virtual destructors which was triggered. I'm not sure
whether this actually creates any undefined or otherwise incorrect
behavior, but it seems like a good thing to fix regardless.
Example compiler warning:
third_party/gperftools/src/tests/profile-handler_unittest.cc:282:5: error:
delete called on '(anonymous namespace)::BusyThread' that has virtual
functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete busy_worker_;
^
-rw-r--r-- | src/tests/profile-handler_unittest.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tests/profile-handler_unittest.cc b/src/tests/profile-handler_unittest.cc index 72a4640..2984d0d 100644 --- a/src/tests/profile-handler_unittest.cc +++ b/src/tests/profile-handler_unittest.cc @@ -45,6 +45,7 @@ namespace { class Thread { public: Thread() : joinable_(false) { } + virtual ~Thread() { } void SetJoinable(bool value) { joinable_ = value; } void Start() { pthread_attr_t attr; |