Fix crash on jack server shutdown

On sink unlinking, existing sink inputs are moved, which in turn calls
a get latency callback, which references the jack client. Therefore,
make sure the sink is unlinked before the client is closed. Failure to
do so might lead to SIGSEGV.
This commit is contained in:
David Henningsson 2010-03-14 20:20:12 +01:00 committed by Colin Guthrie
parent 29845be64d
commit e756467434

View file

@ -475,12 +475,12 @@ void pa__done(pa_module*m) {
if (!(u = m->userdata)) if (!(u = m->userdata))
return; return;
if (u->client)
jack_client_close(u->client);
if (u->sink) if (u->sink)
pa_sink_unlink(u->sink); pa_sink_unlink(u->sink);
if (u->client)
jack_client_close(u->client);
if (u->thread) { if (u->thread) {
pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL); pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL);
pa_thread_free(u->thread); pa_thread_free(u->thread);