From b094e7473b8cbe9c994216c84d1a60d48fe166bb Mon Sep 17 00:00:00 2001 From: Dominik Gleich Date: Fri, 22 Dec 2017 13:34:13 +0100 Subject: [PATCH] Add virtual destructor Summary: Not having a virtual destructor caused tests to fail (cypher_main_visitor, interpreter) sporadically since unfreed memory was re-used incorrectly. Also Valgrind complained constantly. Reviewers: florijan, teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1081 --- src/storage/concurrent_id_mapper.hpp | 1 + src/storage/concurrent_id_mapper_master.hpp | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/storage/concurrent_id_mapper.hpp b/src/storage/concurrent_id_mapper.hpp index 5d27b0321..ad6edd0cd 100644 --- a/src/storage/concurrent_id_mapper.hpp +++ b/src/storage/concurrent_id_mapper.hpp @@ -17,5 +17,6 @@ class ConcurrentIdMapper { public: virtual TId value_to_id(const std::string &value) = 0; virtual const std::string &id_to_value(const TId &id) = 0; + virtual ~ConcurrentIdMapper() {} }; } // namespace storage diff --git a/src/storage/concurrent_id_mapper_master.hpp b/src/storage/concurrent_id_mapper_master.hpp index 388fa98c7..0d0ff241b 100644 --- a/src/storage/concurrent_id_mapper_master.hpp +++ b/src/storage/concurrent_id_mapper_master.hpp @@ -11,9 +11,7 @@ namespace storage { /** Master implementation of ConcurrentIdMapper. */ template -class MasterConcurrentIdMapper - : public SingleNodeConcurrentIdMapper { - +class MasterConcurrentIdMapper : public SingleNodeConcurrentIdMapper { public: MasterConcurrentIdMapper(communication::messaging::System &system); ~MasterConcurrentIdMapper();