mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
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:
parent
940aba8623
commit
ae51b0acf1
1 changed files with 10 additions and 8 deletions
|
|
@ -2209,21 +2209,23 @@ SPA_EXPORT
|
||||||
int jack_client_close (jack_client_t *client)
|
int jack_client_close (jack_client_t *client)
|
||||||
{
|
{
|
||||||
struct client *c = (struct client *) client;
|
struct client *c = (struct client *) client;
|
||||||
|
int res;
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: close", client);
|
pw_log_debug(NAME" %p: close", client);
|
||||||
|
|
||||||
do_sync(c);
|
c->destroyed = true;
|
||||||
|
|
||||||
|
res = jack_deactivate(client);
|
||||||
|
|
||||||
pw_thread_loop_stop(c->context.loop);
|
pw_thread_loop_stop(c->context.loop);
|
||||||
|
|
||||||
c->destroyed = true;
|
|
||||||
pw_context_destroy(c->context.context);
|
pw_context_destroy(c->context.context);
|
||||||
pw_thread_loop_destroy(c->context.loop);
|
pw_thread_loop_destroy(c->context.loop);
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: free", client);
|
pw_log_debug(NAME" %p: free", client);
|
||||||
free(c);
|
free(c);
|
||||||
|
|
||||||
return 0;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue