summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanos Kovacs <jankovac503@gmail.com>2012-08-16 03:47:48 +0300
committerJaska Uimonen <jaska.uimonen@intel.com>2013-02-15 09:39:56 +0200
commit67aa114544e37787c1951db7a138e127b1cd13b9 (patch)
tree138b0504a33ffe6982bab490aa01ad82a1bba14b
parentbd637487001e2a503bdb0a875903972d99f734de (diff)
downloadpulseaudio-panda-67aa114544e37787c1951db7a138e127b1cd13b9.tar.gz
pulseaudio-panda-67aa114544e37787c1951db7a138e127b1cd13b9.tar.bz2
pulseaudio-panda-67aa114544e37787c1951db7a138e127b1cd13b9.zip
make pa_thread_mq_done() safe for subsequent calls
-rw-r--r--src/pulsecore/thread-mq.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pulsecore/thread-mq.c b/src/pulsecore/thread-mq.c
index b492793e..9efcd8a4 100644
--- a/src/pulsecore/thread-mq.c
+++ b/src/pulsecore/thread-mq.c
@@ -97,6 +97,14 @@ void pa_thread_mq_init(pa_thread_mq *q, pa_mainloop_api *mainloop, pa_rtpoll *rt
void pa_thread_mq_done(pa_thread_mq *q) {
pa_assert(q);
+ if (!q->mainloop && !q->inq && !q->outq &&
+ !q->read_event && !q->write_event)
+ return;
+
+ pa_assert(q->mainloop);
+ pa_assert(q->inq && q->outq);
+ pa_assert(q->read_event && q->write_event);
+
/* Since we are called from main context we can be sure that the
* inq is empty. However, the outq might still contain messages
* for the main loop, which we need to dispatch (e.g. release