Free structures after ending ncurses.
This commit is contained in:
parent
578fe9af27
commit
f28c1ce6fd
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user