Fix: Prevent calling pa_rtpoll_free() for a NULL rtpoll

Flushing the asyncmsgq can cause arbitrarily callbacks to run, potentially
causing recursion into pa_thread_mq_done again. Because of this; rtpoll which
is cleared in the second iteration is tried to free once again by the first
iteration leading to PA crash.
This commit is contained in:
Sagar Nageshmurthy 2015-03-24 17:17:03 +05:30 committed by David Henningsson
parent 498689926f
commit ff329cdabb

View file

@ -1575,9 +1575,9 @@ static void stop_thread(struct userdata *u) {
}
if (u->rtpoll) {
pa_thread_mq_done(&u->thread_mq);
pa_rtpoll_free(u->rtpoll);
u->rtpoll = NULL;
pa_thread_mq_done(&u->thread_mq);
}
if (u->transport) {