diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c index a991bbcc98..a543b79aae 100644 --- a/gnucash/gnome-utils/gnc-main-window.c +++ b/gnucash/gnome-utils/gnc-main-window.c @@ -1261,6 +1261,7 @@ gnc_main_window_prompt_for_save (GtkWidget *window) _("If you don't save, changes from the past %d days and %d hours will be discarded."); time64 oldest_change; gint minutes, hours, days; + guint timer_source = 0; if (!gnc_current_session_exist()) return FALSE; session = gnc_get_current_session(); @@ -1330,10 +1331,12 @@ gnc_main_window_prompt_for_save (GtkWidget *window) g_object_set (G_OBJECT (label), "xalign", 0.0, NULL); g_object_set_data (G_OBJECT (dialog), "count-down-label", label); - g_timeout_add_seconds (1, (GSourceFunc)auto_save_countdown, dialog); + timer_source = g_timeout_add_seconds (1, (GSourceFunc)auto_save_countdown, dialog); } response = gtk_dialog_run (GTK_DIALOG (dialog)); + if (timer_source) + g_source_remove (timer_source); gtk_widget_destroy(dialog); switch (response)