The following code generates error: non alligned pointer being freed.
What can I do to fix it?
Code:
Experto::~Experto(){
for(int i = 0; i < 7; ++i){
delete this->tableroIndices[i];
this->tableroIndices[i] = 0;
}
delete this->tableroIndices;
delete this->listaEstados;
delete this->solucion;
this->tableroIndices = 0;
listaEstados = 0;
solucion = 0;
}
Here's the tableroIndice's declaration and creation process....
Code:
char ** tableroIndices;
Code:
void Experto::inicializarTableroIndices(){
this->tableroIndices = new char * [7];
char indiceTablero = '0';
for(int i = 0; i < 7; ++i){
tableroIndices[i] = new char[7];
for(int j = 0; j < 7; ++j){
if((i < 2 || i > 4) && (j < 2 || j > 4)){
this->tableroIndices[i][j] = '_';
}else{
this->tableroIndices[i][j] = indiceTablero;
indiceTablero += 1;
if(indiceTablero == ':'){
indiceTablero += 7;
}
}
}
}
}
Thanks for helping!