Free structures after ending ncurses.

This commit is contained in:
Murilo Pereira 2011-02-09 23:50:24 -02:00
parent 578fe9af27
commit f28c1ce6fd
2 changed files with 4 additions and 5 deletions

View File

@ -224,9 +224,8 @@ void initialize_game() {
return;
}
void end_game(struct deck *deck) {
print_deck(deck); // debugging purposes
/*delete_deck(deck); this is segfaulting */
void end_game() {
delete_deck(deck);
return;
}

View File

@ -20,16 +20,16 @@ int main(int argc, const char *argv[]) {
break;
case 'q':
case 'Q':
end_game();
end_curses();
end_game();
exit(0);
}
}
while (1) {
if ((key = getch()) == 'q' || key == 'Q') {
end_game();
end_curses();
end_game();
exit(0);
} else {
handle_keyboard_event(key);