summaryrefslogtreecommitdiff
path: root/src/common/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/console.c')
-rw-r--r--src/common/console.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/common/console.c b/src/common/console.c
index c228ab790..248dd7b45 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -337,15 +337,16 @@ int console_parse_timer(int tid, unsigned int tick, int id, intptr_t data) {
return 0;
}
void console_parse_final(void) {
- InterlockedDecrement(&console->ptstate);
- racond_signal(console->ptcond);
-
- /* wait for thread to close */
- rathread_wait(console->pthread, NULL);
-
- racond_destroy(console->ptcond);
- ramutex_destroy(console->ptmutex);
-
+ if( console->ptstate ) {
+ InterlockedDecrement(&console->ptstate);
+ racond_signal(console->ptcond);
+
+ /* wait for thread to close */
+ rathread_wait(console->pthread, NULL);
+
+ racond_destroy(console->ptcond);
+ ramutex_destroy(console->ptmutex);
+ }
}
void console_parse_init(void) {
cinput.count = 0;