aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/Game.cpp')
-rw-r--r--src/game_tab/Game.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/game_tab/Game.cpp b/src/game_tab/Game.cpp
index e26efd7..8b52ca6 100644
--- a/src/game_tab/Game.cpp
+++ b/src/game_tab/Game.cpp
@@ -15,13 +15,19 @@ Game::Game(std::string fen) : current(NULL), moves(NULL), result("*") {
board = chessarbiter::FENParser::Parse(fen).board;
}
-Game::Game(HalfMove *m, std::string initial_fen): result("*") {
+Game::Game(HalfMove *m, std::string initial_fen) : result("*") {
moves = m;
current = m;
this->initial_fen = initial_fen;
board = chessarbiter::FENParser::Parse(initial_fen).board;
}
+Game::~Game() {
+ if (moves != NULL) {
+ delete moves;
+ }
+}
+
std::string Game::GetBoard() { return (board); }
std::string Game::GetTag(std::string tagname) { return (tags[tagname]); }