diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp index 7a6867affd113580821a4c0cc29a845f006c596d..20550615d66118c7af9b1b22af0af589f7ad6ab4 100644 --- a/src/sbbs3/main.cpp +++ b/src/sbbs3/main.cpp @@ -2044,6 +2044,7 @@ void input_thread(void *arg) sbbs->sys_status|=SS_ABORT; /* as though Ctrl-C were hit */ sbbs->input_thread_running = false; + sbbs->terminate_output_thread = true; if(node_socket[sbbs->cfg.node_num-1]==INVALID_SOCKET) // Shutdown locally sbbs->terminated = true; // Signal JS to stop execution @@ -2318,9 +2319,10 @@ void output_thread(void* arg) } } #endif + sbbs->terminate_output_thread = false; /* Note: do not terminate when online==FALSE, that is expected for the terminal server output_thread */ - while(sbbs->client_socket!=INVALID_SOCKET && !terminate_server) { + while(sbbs->client_socket!=INVALID_SOCKET && !terminate_server && !sbbs->terminate_output_thread) { /* * I'd like to check the linear buffer against the highwater * at this point, but it would get too clumsy imho - Deuce @@ -2328,7 +2330,7 @@ void output_thread(void* arg) * Actually, another option would just be to have the size * of the linear buffer equal to the MSS... any larger and * you could have small sends off the end. this would - * probobly be even clumbsier + * probably be even clumsier */ if(bufbot == buftop) { /* Wait for something to output in the RingBuffer */ diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h index 5ec2f1ca62693b860fb80e3eddd7cee522c03d1d..994b8fb19db7b99c2dbb324e3408e014425786f3 100644 --- a/src/sbbs3/sbbs.h +++ b/src/sbbs3/sbbs.h @@ -380,6 +380,7 @@ public: bool event_thread_running; bool output_thread_running; bool input_thread_running; + bool terminate_output_thread; #ifdef JAVASCRIPT