From 41f4a92fa97deb951833b0807c2359518e87ae15 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <lfleischer@calcurse.org>
Date: Sat, 25 Aug 2018 08:47:18 +0200
Subject: Only stop threads when exiting from interactive mode

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
---
 src/utils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/utils.c b/src/utils.c
index bb90e36..b90a9bf 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -74,11 +74,11 @@ void exit_calcurse(int status)
 {
 	int was_interactive;
 
-	ui_calendar_stop_date_thread();
-	io_stop_psave_thread();
-
 	if (ui_mode == UI_CURSES) {
 		notify_stop_main_thread();
+		ui_calendar_stop_date_thread();
+		io_stop_psave_thread();
+
 		clear();
 		wins_refresh();
 		endwin();
-- 
cgit v1.2.3-70-g09d2