From b709dff23d94b93ffa484a7bfe46441ece79520f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 1 Feb 2013 00:19:03 +1100 Subject: Clear yearly statistics when closing data file Another oversight of what needed to be done when cleaning up the UI after closing the data file. Reported-by: Sergey Starosek Signed-off-by: Dirk Hohndel --- gtk-gui.c | 1 + statistics.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk-gui.c b/gtk-gui.c index b55ee8d0a..871ecc0ad 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -249,6 +249,7 @@ static void file_close(GtkWidget *w, gpointer data) process_selected_dives(); clear_stats_widgets(); clear_events(); + show_dive_stats(NULL); /* clear the equipment page */ clear_equipment_widgets(); diff --git a/statistics.c b/statistics.c index fbc4f9273..001c45155 100644 --- a/statistics.c +++ b/statistics.c @@ -543,7 +543,8 @@ static void show_single_dive_stats(struct dive *dive) struct tm tm; process_all_dives(dive, &prev_dive); - + if (!dive) + return; utc_mkdate(dive->when, &tm); snprintf(buf, sizeof(buf), /*++GETTEXT 80 chars: weekday, monthname, day, year, hour, min */ -- cgit v1.2.3-70-g09d2