Commit 3516738f authored by Denis Kuplyakov's avatar Denis Kuplyakov

Added destructor for KReversiView

Added destructor for KReversiView to deleted owned game object. This is
done simply by calling setGame(0).
parent f5092d4a
...@@ -103,6 +103,11 @@ void KReversiView::setAnimationSpeed(int speed) ...@@ -103,6 +103,11 @@ void KReversiView::setAnimationSpeed(int speed)
Q_ARG(QVariant, value)); Q_ARG(QVariant, value));
} }
KReversiView::~KReversiView()
{
setGame(0);
}
void KReversiView::updateBoard() void KReversiView::updateBoard()
{ {
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
......
...@@ -87,6 +87,10 @@ public: ...@@ -87,6 +87,10 @@ public:
*/ */
void setAnimationSpeed(int speed); void setAnimationSpeed(int speed);
/**
* Destructor used to delete game object owned by class
*/
~KReversiView();
public slots: public slots:
/** /**
* Triggered on user click on board, connected to QML signal * Triggered on user click on board, connected to QML signal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment