From 5766c7c53a66ba83471231017cfa28eefecd95bc Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Wed, 24 Sep 2014 16:37:32 +0200 Subject: [PATCH] Add empty virtual destructor for lru_node_t. history_lru_node_t has implicit destructor defined. However, because it's being deleted as lru_node_t, it's not being actually called, as lru_node_t doesn't have a virtual destructor. --- lru.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lru.h b/lru.h index 85280b1fc..e6418c68b 100644 --- a/lru.h +++ b/lru.h @@ -36,6 +36,9 @@ public: /** Constructor */ lru_node_t(const wcstring &pkey) : prev(NULL), next(NULL), key(pkey) { } + /** Virtual destructor that does nothing for classes that inherit lru_node_t */ + virtual ~lru_node_t() {} + /** operator< for std::set */ bool operator<(const lru_node_t &other) const {