From 069ce4574f5644766ad3f01fa22dfa77de27df17 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 3 Aug 2014 10:58:19 +0200 Subject: [PATCH] ag_window_can_close() now checks for unsaved (db_id == -1) charts, too --- src/ag-window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ag-window.c b/src/ag-window.c index a306a09..a2ef137 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -107,7 +107,11 @@ ag_window_can_close(AgWindow *window, gboolean display_dialog) if (priv->chart) { save_data = ag_chart_get_db_save(priv->chart, db_id); - if (!ag_db_save_identical(priv->saved_data, save_data)) { + if ( + !ag_db_save_identical(priv->saved_data, save_data) + || !(priv->saved_data) + || (priv->saved_data->db_id == -1) + ) { g_debug("Save is needed!"); if (display_dialog) {