Explorar o código

add missing virtual destructors

Andrey Filipenkov %!s(int64=3) %!d(string=hai) anos
pai
achega
a1cf120ea6

+ 1 - 0
AI/Nullkiller/Analyzers/ArmyManager.h

@@ -41,6 +41,7 @@ struct ArmyUpgradeInfo
 class DLL_EXPORT IArmyManager //: public: IAbstractManager
 {
 public:
+	virtual ~IArmyManager() = default;
 	virtual void update() = 0;
 	virtual ui64 howManyReinforcementsCanBuy(const CCreatureSet * target, const CGDwelling * source) const = 0;
 	virtual	ui64 howManyReinforcementsCanBuy(

+ 3 - 1
AI/Nullkiller/Analyzers/HeroManager.h

@@ -20,6 +20,7 @@
 class DLL_EXPORT IHeroManager //: public: IAbstractManager
 {
 public:
+	virtual ~IHeroManager() = default;
 	virtual const std::map<HeroPtr, HeroRole> & getHeroRoles() const = 0;
 	virtual int selectBestSkill(const HeroPtr & hero, const std::vector<SecondarySkill> & skills) const = 0;
 	virtual HeroRole getHeroRole(const HeroPtr & hero) const = 0;
@@ -31,6 +32,7 @@ public:
 class DLL_EXPORT ISecondarySkillRule
 {
 public:
+	virtual ~ISecondarySkillRule() = default;
 	virtual void evaluateScore(const CGHeroInstance * hero, SecondarySkill skill, float & score) const = 0;
 };
 
@@ -102,4 +104,4 @@ private:
 
 public:
 	void evaluateScore(const CGHeroInstance * hero, SecondarySkill skill, float & score) const override;
-};
+};

+ 1 - 0
AI/Nullkiller/Engine/PriorityEvaluator.h

@@ -61,6 +61,7 @@ struct DLL_EXPORT EvaluationContext
 class IEvaluationContextBuilder
 {
 public:
+	virtual ~IEvaluationContextBuilder() = default;
 	virtual void buildEvaluationContext(EvaluationContext & evaluationContext, Goals::TSubgoal goal) const = 0;
 };
 

+ 3 - 1
AI/Nullkiller/Pathfinding/Actions/SpecialAction.h

@@ -18,6 +18,8 @@ struct AIPathNode;
 class SpecialAction
 {
 public:
+	virtual ~SpecialAction() = default;
+
 	virtual bool canAct(const AIPathNode * source) const
 	{
 		return true;
@@ -39,4 +41,4 @@ public:
 	virtual std::string toString() const = 0;
 
 	virtual const CGObjectInstance * targetObject() const { return nullptr; }
-};
+};

+ 3 - 2
AI/Nullkiller/Pathfinding/Actors.h

@@ -75,7 +75,8 @@ public:
 	TResources armyCost;
 	std::shared_ptr<TurnInfo> tiCache;
 
-	ChainActor(){}
+	ChainActor() = default;
+	virtual ~ChainActor() = default;
 
 	virtual std::string toString() const;
 	ExchangeResult tryExchangeNoLock(const ChainActor * other) const { return tryExchangeNoLock(this, other); }
@@ -168,4 +169,4 @@ private:
 public:
 	TownGarrisonActor(const CGTownInstance * town, uint64_t chainMask);
 	virtual std::string toString() const override;
-};
+};

+ 1 - 0
AI/VCAI/ArmyManager.h

@@ -28,6 +28,7 @@ struct SlotInfo
 class DLL_EXPORT IArmyManager //: public: IAbstractManager
 {
 public:
+	virtual ~IArmyManager() = default;
 	virtual void init(CPlayerSpecificInfoCallback * CB) = 0;
 	virtual void setAI(VCAI * AI) = 0;
 	virtual bool canGetArmy(const CArmedInstance * target, const CArmedInstance * source) const = 0;

+ 2 - 0
CCallback.h

@@ -35,6 +35,8 @@ struct ArtifactLocation;
 class IBattleCallback
 {
 public:
+	virtual ~IBattleCallback() = default;
+
 	bool waitTillRealize; //if true, request functions will return after they are realized by server
 	bool unlockGsWhenWaiting;//if true after sending each request, gs mutex will be unlocked so the changes can be applied; NOTICE caller must have gs mx locked prior to any call to actiob callback!
 	//battle

+ 1 - 0
client/gui/SDL_Extensions.h

@@ -155,6 +155,7 @@ typedef void (*BlitterWithRotationVal)(SDL_Surface *src,SDL_Rect srcRect, SDL_Su
 class ColorShifter
 {
 public:
+	virtual ~ColorShifter() = default;
 	virtual SDL_Color shiftColor(SDL_Color clr) const = 0;
 };
 

+ 2 - 0
include/vcmi/ServerCallback.h

@@ -27,6 +27,8 @@ struct CatapultAttack;
 class DLL_LINKAGE ServerCallback
 {
 public:
+	virtual ~ServerCallback() = default;
+
 	virtual void complain(const std::string & problem) = 0;
 	virtual bool describeChanges() const = 0;
 

+ 4 - 0
lib/CPathfinder.h

@@ -386,6 +386,9 @@ class DLL_LINKAGE INodeStorage
 {
 public:
 	using ELayer = EPathfindingLayer;
+
+	virtual ~INodeStorage() = default;
+
 	virtual std::vector<CGPathNode *> getInitialNodes() = 0;
 
 	virtual std::vector<CGPathNode *> calculateNeighbours(
@@ -448,6 +451,7 @@ public:
 	PathfinderConfig(
 		std::shared_ptr<INodeStorage> nodeStorage,
 		std::vector<std::shared_ptr<IPathfindingRule>> rules);
+	virtual ~PathfinderConfig() = default;
 
 	virtual CPathfinderHelper * getOrCreatePathfinderHelper(const PathNodeInfo & source, CGameState * gs) = 0;
 };