diff options
Diffstat (limited to 'result')
| -rw-r--r-- | result/diceresult.cpp | 14 | ||||
| -rw-r--r-- | result/diceresult.h | 4 | ||||
| -rw-r--r-- | result/stringresult.cpp | 4 | ||||
| -rw-r--r-- | result/stringresult.h | 4 |
4 files changed, 18 insertions, 8 deletions
diff --git a/result/diceresult.cpp b/result/diceresult.cpp index 0cabb11..f87079a 100644 --- a/result/diceresult.cpp +++ b/result/diceresult.cpp @@ -35,17 +35,15 @@ QList<Die*>& DiceResult::getResultList() } void DiceResult::setResultList(QList<Die*> list) { + qDeleteAll(m_diceValues.begin(), m_diceValues.end()); m_diceValues.clear(); m_diceValues << list; } -//bool DiceResult::isScalar() const -//{ -// if(m_diceValues.size()==1) -// { -// return true; -// } -// return false; -//} +DiceResult::~DiceResult() +{ + qDeleteAll(m_diceValues.begin(), m_diceValues.end()); + m_diceValues.clear(); +} QVariant DiceResult::getResult(RESULT_TYPE type) { diff --git a/result/diceresult.h b/result/diceresult.h index 838a83d..b805e73 100644 --- a/result/diceresult.h +++ b/result/diceresult.h @@ -35,6 +35,10 @@ public: * @brief DiceResult */ DiceResult(); + /** + * @brief ~DiceResult + */ + virtual ~DiceResult(); /** * @brief getResultList diff --git a/result/stringresult.cpp b/result/stringresult.cpp index 4831a76..9f7d2e1 100644 --- a/result/stringresult.cpp +++ b/result/stringresult.cpp @@ -8,6 +8,10 @@ void StringResult::setText(QString text) { m_value=text; } +StringResult::~StringResult() +{ + +} QString StringResult::getText() const { diff --git a/result/stringresult.h b/result/stringresult.h index caa7e06..17c43cd 100644 --- a/result/stringresult.h +++ b/result/stringresult.h @@ -13,6 +13,10 @@ public: * @brief StringResult */ StringResult(); + /** + * @brief StringResult + */ + virtual ~StringResult(); /** * @brief setText * @param text |