diff --git a/softsynth.c b/softsynth.c index 4472ff4..21f3cb8 100644 --- a/softsynth.c +++ b/softsynth.c @@ -172,7 +172,7 @@ static void request_espeak_stop(void) pthread_mutex_lock(&queue_guard); runner_must_stop = 1; pthread_cond_signal(&runner_awake); /* Wake runner, if necessary. */ - while(runner_must_stop == 1) + while(should_run && (runner_must_stop == 1)) pthread_cond_wait(&stop_acknowledged, &queue_guard); /* wait for acknowledgement. */ pthread_mutex_unlock(&queue_guard); }