free memory
This commit is contained in:
parent
8143fa3a85
commit
2af8608de8
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "../includes/Plateau.hpp"
|
||||
|
||||
Plateau::Plateau(int t) {
|
||||
// Création du plateau vide
|
||||
plateau = new Piece **[t];
|
||||
for (int i = 0; i < t; i++) {
|
||||
plateau[i] = new Piece *[t];
|
||||
|
@ -10,7 +11,12 @@ Plateau::Plateau(int t) {
|
|||
}
|
||||
}
|
||||
|
||||
Plateau::~Plateau() {}
|
||||
Plateau::~Plateau() {
|
||||
for (int i = 0; i < taille; i++) {
|
||||
delete[] plateau[i];
|
||||
}
|
||||
delete[] plateau;
|
||||
}
|
||||
|
||||
Plateau::Plateau(const Plateau &) {}
|
||||
|
||||
|
|
Reference in a new issue