Fix building under clang-7
Currently the build fails because of -Wdelete-non-virtual-dtor warnings. This catches when an object is destructed, has a non-virtual destructor, and is an abstract base class or a non-final class with virtual functions. The warning happens inside unique_ptr<T>::~unique_ptr. The warning is to prevent somebody writing code like this: class MySceneEndCondition : public CSceneEndCondition { ~MySceneEndCondition() { /* some complex logic */ } }; // this won't call MySceneEndCondition's destructor, potentially // leading to leaks or segfaults: std::unique_ptr<CSceneEndCondition> p{new MySceneEndCondition()};1008-fix
parent
0391aaf773
commit
5cec29f4e6
|
@ -85,7 +85,7 @@ protected:
|
|||
* \class CSceneEndCondition
|
||||
* \brief Scene end condition
|
||||
*/
|
||||
class CSceneEndCondition : public CSceneCondition
|
||||
class CSceneEndCondition final : public CSceneCondition
|
||||
{
|
||||
public:
|
||||
int winTeam = 0;
|
||||
|
@ -109,7 +109,7 @@ public:
|
|||
* \class CAudioChangeCondition
|
||||
* \brief Audio change condition
|
||||
*/
|
||||
class CAudioChangeCondition : public CSceneCondition
|
||||
class CAudioChangeCondition final : public CSceneCondition
|
||||
{
|
||||
public:
|
||||
std::string music = "";
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
* \brief Scoreboard rule for destroying other objects
|
||||
* \see CScoreboard::AddKillRule()
|
||||
*/
|
||||
class CScoreboardKillRule : public CScoreboardRule, public CObjectCondition
|
||||
class CScoreboardKillRule final : public CScoreboardRule, public CObjectCondition
|
||||
{
|
||||
public:
|
||||
//! Read from line in scene file
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
* \brief Scoreboard rule for EndMissionTake rewards
|
||||
* \see CScoreboard::AddEndTakeRule()
|
||||
*/
|
||||
class CScoreboardEndTakeRule : public CScoreboardRule
|
||||
class CScoreboardEndTakeRule final : public CScoreboardRule
|
||||
{
|
||||
public:
|
||||
int team = 0;
|
||||
|
@ -122,4 +122,4 @@ private:
|
|||
std::vector<std::unique_ptr<CScoreboardEndTakeRule>> m_rulesEndTake = {};
|
||||
std::map<int, int> m_score;
|
||||
int m_finishCounter = 0;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue