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