diff --git a/src/gamestate.cpp b/src/gamestate.cpp index 9cb6c17..ddb1d11 100644 --- a/src/gamestate.cpp +++ b/src/gamestate.cpp @@ -16,6 +16,11 @@ GameState::GameState(QObject* parent, bool preDealCards) : QObject{parent} { } } +GameState::~GameState() { + qDebug() << "Destroying GameState"; + cleanupBoard(false); +} + void GameState::dealCards() { qDebug() << "Dealing cards"; cleanupBoard(false); diff --git a/src/gamestate.h b/src/gamestate.h index 582e2bf..1bf03ce 100644 --- a/src/gamestate.h +++ b/src/gamestate.h @@ -20,6 +20,7 @@ class GameState : public QObject { public: explicit GameState(QObject* parent = nullptr, bool preDealCards = true); + ~GameState(); // Getters QVariantList drawPile() const;