diff --git a/src/phmain.c b/src/phmain.c index f336286a..61130459 100644 --- a/src/phmain.c +++ b/src/phmain.c @@ -100,9 +100,15 @@ extern uint64_t gpls_nbr; #ifdef HAVE_SIGACTION static struct sigaction action; static void sighup_hdlr(int sig); +#ifdef HAVE_NCURSES +extern int end_ncurses(void); +#endif static void sighup_hdlr(int sig) { +#ifdef HAVE_NCURSES + end_ncurses(); +#endif if(sig == SIGINT) log_critical("SIGINT detected! PhotoRec has been killed.\n"); else if(sig == SIGHUP) diff --git a/src/testdisk.c b/src/testdisk.c index 78f5523b..52814ed8 100644 --- a/src/testdisk.c +++ b/src/testdisk.c @@ -79,6 +79,9 @@ static struct sigaction action; static void sighup_hdlr(int sig) { +#ifdef HAVE_NCURSES + end_ncurses(); +#endif if(sig == SIGINT) log_critical("SIGINT detected! PhotoRec has been killed.\n"); else if(sig == SIGHUP)