From f28c1ce6fd0227a8a7c64903aabcb0ad83376a88 Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Wed, 9 Feb 2011 23:50:24 -0200 Subject: [PATCH] Free structures after ending ncurses. --- lib/game.c | 5 ++--- lib/ttysolitaire.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/game.c b/lib/game.c index b73c3b0..61caec8 100644 --- a/lib/game.c +++ b/lib/game.c @@ -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; } diff --git a/lib/ttysolitaire.c b/lib/ttysolitaire.c index 68e9c4d..a13e8df 100644 --- a/lib/ttysolitaire.c +++ b/lib/ttysolitaire.c @@ -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);