From 595cd8988d444c9abfd60dfba948cdb57088082b Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Tue, 25 Oct 2016 20:21:05 +0100 Subject: [PATCH] mds/MDSRank.h: make destructor protected MDSRank class is inherited from, but doesn't have virtual destructor. Making destructor protected prevents possibility of deleting derived classes using base class pointer. Signed-off-by: Michal Jarzabek --- src/mds/MDSRank.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mds/MDSRank.h b/src/mds/MDSRank.h index 2a2ea75b2af1..19eab8041076 100644 --- a/src/mds/MDSRank.h +++ b/src/mds/MDSRank.h @@ -280,8 +280,12 @@ class MDSRank { MonClient *monc_, Context *respawn_hook_, Context *suicide_hook_); + + protected: ~MDSRank(); + public: + // Daemon lifetime functions: these guys break the abstraction // and call up into the parent MDSDaemon instance. It's kind // of unavoidable: if we want any depth into our calls -- 2.47.3