diff --git a/client.c b/client.c index f539f58..5d6a382 100644 --- a/client.c +++ b/client.c @@ -731,7 +731,7 @@ jack_client_close (jack_client_t *client) req.type = DropClient; req.x.client_id = client->control->id; - /* stop the thread */ + /* stop the thread that communicates with the jack server */ pthread_cancel (client->thread); pthread_join (client->thread, &status); @@ -740,13 +740,14 @@ jack_client_close (jack_client_t *client) shmdt (client->engine); for (node = client->port_segments; node; node = g_slist_next (node)) { - jack_port_segment_info_t *si; - si = (jack_port_segment_info_t *) node->data; - shmdt (si->address); - free (si); + shmdt (((jack_port_segment_info_t *) node->data)->address); + free (node->data); } - g_slist_free (client->port_segments); + + for (node = client->ports; node; node = g_slist_next (node)) { + free (node->data); + } g_slist_free (client->ports); if (client->graph_wait_fd) { diff --git a/configure.in b/configure.in index 4c2f9b2..90c2f72 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_CONFIG_AUX_DIR(.) JACK_MAJOR_VERSION=0 JACK_MINOR_VERSION=10 -JACK_MICRO_VERSION=0 +JACK_MICRO_VERSION=1 BETA= diff --git a/engine.c b/engine.c index bfcdd17..bf914b8 100644 --- a/engine.c +++ b/engine.c @@ -192,15 +192,16 @@ jack_cleanup_clients (jack_engine_t *engine) { jack_client_control_t *ctl; jack_client_internal_t *client; - GSList *node; - GSList *remove = 0; + GSList *node, *tmp; static int x = 0; x++; pthread_mutex_lock (&engine->graph_lock); - for (node = engine->clients; node; node = g_slist_next (node)) { + for (node = engine->clients; node; ) { + + tmp = g_slist_next (node); client = (jack_client_internal_t *) node->data; ctl = client->control; @@ -210,20 +211,18 @@ jack_cleanup_clients (jack_engine_t *engine) } if (ctl->state > NotTriggered) { - remove = g_slist_prepend (remove, node->data); + if (engine->verbose) { fprintf (stderr, "%d: removing failed client %s\n", x, ctl->name); } - } - } - pthread_mutex_unlock (&engine->graph_lock); - - if (remove) { - for (node = remove; node; node = g_slist_next (node)) { + jack_remove_client (engine, (jack_client_internal_t *) node->data); } - g_slist_free (remove); + + node = tmp; } + + pthread_mutex_unlock (&engine->graph_lock); } static int @@ -840,14 +839,14 @@ handle_client_jack_error (jack_engine_t *engine, int fd) } } - pthread_mutex_unlock (&engine->graph_lock); - if (client == 0) { + pthread_mutex_unlock (&engine->graph_lock); jack_error ("i/o error on unknown client fd %d", fd); return -1; } jack_remove_client (engine, client); + pthread_mutex_unlock (&engine->graph_lock); return 0; } @@ -1384,8 +1383,6 @@ jack_remove_client (jack_engine_t *engine, jack_client_internal_t *client) fprintf (stderr, "removing client %s\n", client->control->name); } - pthread_mutex_lock (&engine->graph_lock); - client->control->dead = TRUE; if (client == engine->timebase_client) { @@ -1422,8 +1419,6 @@ jack_remove_client (jack_engine_t *engine, jack_client_internal_t *client) close (client->request_fd); jack_client_delete (engine, client); - - pthread_mutex_unlock (&engine->graph_lock); } static void @@ -1875,9 +1870,9 @@ jack_port_do_connect (jack_engine_t *engine, dstport->connections = g_slist_prepend (dstport->connections, connection); srcport->connections = g_slist_prepend (srcport->connections, connection); - - jack_sort_graph (engine, FALSE); + jack_sort_graph (engine, FALSE); + jack_send_connection_notification (engine, srcport->shared->client_id, src_id, dst_id, TRUE); jack_send_connection_notification (engine, dstport->shared->client_id, dst_id, src_id, TRUE); } diff --git a/jackd.c b/jackd.c index 2582595..85eae9a 100644 --- a/jackd.c +++ b/jackd.c @@ -284,9 +284,9 @@ main (int argc, char *argv[]) hw_monitoring = 1; break; - case 'h': default: fprintf (stderr, "unknown option character %c\n", opt); + case 'h': usage(); return -1; }