jack: stop data thread when closing client

Make sure we deactivate and stop the data thread when closing a
client or we might get segfaults.
This commit is contained in:
Wim Taymans 2020-01-16 13:29:56 +01:00
parent 940aba8623
commit ae51b0acf1

View file

@ -2209,21 +2209,23 @@ SPA_EXPORT
int jack_client_close (jack_client_t *client)
{
struct client *c = (struct client *) client;
int res;
pw_log_debug(NAME" %p: close", client);
do_sync(c);
c->destroyed = true;
res = jack_deactivate(client);
pw_thread_loop_stop(c->context.loop);
c->destroyed = true;
pw_context_destroy(c->context.context);
pw_thread_loop_destroy(c->context.loop);
pw_log_debug(NAME" %p: free", client);
free(c);
return 0;
return res;
}
SPA_EXPORT