diff options
| author | 2015-04-08 21:34:02 +0200 | |
|---|---|---|
| committer | 2015-04-08 21:34:02 +0200 | |
| commit | 5cfe48265ebad0ffa0a980dbc2d131fceeecdf3b (patch) | |
| tree | 0d8d654046e18ad90a7a06e00e0e56c375a230fd /result | |
| parent | 9192ba51a362715061cce1104b5543f7e93bf70f (diff) | |
| download | OneRoll-5cfe48265ebad0ffa0a980dbc2d131fceeecdf3b.tar.gz OneRoll-5cfe48265ebad0ffa0a980dbc2d131fceeecdf3b.zip | |
-remove memory leaks
-delete created objects
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 |