From 5da97d7c0e6d178f1e265014cbcd061bec071b32 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 6 Dec 2024 16:59:54 +0100 Subject: [PATCH] Add a destructor --- src/gamestate.cpp | 5 +++++ src/gamestate.h | 1 + 2 files changed, 6 insertions(+) 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;