From a812f61c918d1863ff742bf17f45f4c184da55ed Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Mon, 5 Oct 2009 23:51:16 +0000 Subject: [PATCH] Fix (I think!?) for crash bug when starting a new drawing after using Label tool. --- src/tuxpaint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index fde3594b3..bf0ee5be8 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -20381,7 +20381,7 @@ void rec_undo_label(void) return; } - if (have_to_rec_label_node) + if (have_to_rec_label_node && current_label_node != NULL) /* FIXME: Bill added the "current_label_node != NULL" test to avoid crashing in the following situation: (1) use label tool, (2) start new drawing, (3) change to paint tool & try to draw. Is this test correct, or is the crash here an artifact of a different bug? -bjk 2009.10.05 */ { current_label_node->save_undoid = cur_undo; text_undo[cur_undo] = 1; @@ -20569,6 +20569,7 @@ void delete_label_list(struct label_node** ref_head) while(current != NULL) { printf("%x current\n", current); //FIXAM +fflush(stdout); next = current->next_to_up_label_node; free(current);