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; return;
} }
void end_game(struct deck *deck) { void end_game() {
print_deck(deck); // debugging purposes delete_deck(deck);
/*delete_deck(deck); this is segfaulting */
return; return;
} }

View File

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