diff options
| author | 2015-04-08 21:34:02 +0200 | |
|---|---|---|
| committer | 2015-04-08 21:34:02 +0200 | |
| commit | 5cfe48265ebad0ffa0a980dbc2d131fceeecdf3b (patch) | |
| tree | 0d8d654046e18ad90a7a06e00e0e56c375a230fd /result/diceresult.cpp | |
| parent | 9192ba51a362715061cce1104b5543f7e93bf70f (diff) | |
| download | OneRoll-5cfe48265ebad0ffa0a980dbc2d131fceeecdf3b.tar.gz OneRoll-5cfe48265ebad0ffa0a980dbc2d131fceeecdf3b.zip | |
-remove memory leaks
-delete created objects
Diffstat (limited to 'result/diceresult.cpp')
| -rw-r--r-- | result/diceresult.cpp | 14 |
1 files changed, 6 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) { |