From 8fe03b8bcef9f5a3a822055a3c4ab65cfe1baedb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 28 Dec 2008 19:48:53 +0100 Subject: decoder: terminate decoder thread before MPD cleanup When MPD exits, it should manually free all resources in use, to allow easy memory leak debugging. Make the decoder thread terminate during that. --- src/decoder_thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/decoder_thread.c') diff --git a/src/decoder_thread.c b/src/decoder_thread.c index 0ae1a88f9..2be0937da 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -204,7 +204,7 @@ static void decoder_run(void) static void * decoder_task(G_GNUC_UNUSED void *arg) { - while (1) { + do { assert(dc.state == DECODE_STATE_STOP || dc.state == DECODE_STATE_ERROR); @@ -226,7 +226,7 @@ static void * decoder_task(G_GNUC_UNUSED void *arg) notify_wait(&dc.notify); break; } - } + } while (dc.command != DECODE_COMMAND_NONE || !dc.quit); return NULL; } -- cgit v1.2.3