Exit programm properly when exit with KEY_DELETE

This commit is contained in:
Yorick Barbanneau 2021-10-24 17:27:27 +02:00
parent 96499a06cb
commit 033a436be2

View file

@ -128,10 +128,15 @@ void set_next_player_move(s_move * m, p_view v)
case KEY_BACKSPACE:
case 127:
case '\b':
// if we are in inner TTT window, go back to outer
if ( outer_selected == true && v->p_uttt->inception_level == 2 ) {
outer_selected = false;
}
else {
// If not Exit programm, but we need to do it properly.
free_utictactoe(v->p_uttt);
free_move(m);
free_view(v);
exit(1);
}
break;