From 9cc64953065e5142a11ed0a5be75027558de9b9e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 3 Sep 2015 20:20:03 -0700 Subject: [PATCH] JACK: fix infinite loop when refreshing devices closes #9 --- src/jack.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/jack.cpp b/src/jack.cpp index d085a3c..14f089a 100644 --- a/src/jack.cpp +++ b/src/jack.cpp @@ -101,7 +101,7 @@ static int refresh_devices_bare(SoundIoPrivate *si) { SoundIoList clients = {0}; const char **port_name_ptr = port_names; - while (*port_name_ptr) { + for (; *port_name_ptr; port_name_ptr += 1) { const char *client_and_port_name = *port_name_ptr; int client_and_port_name_len = strlen(client_and_port_name); jack_port_t *jport = jack_port_by_name(sij->client, client_and_port_name); @@ -155,8 +155,6 @@ static int refresh_devices_bare(SoundIoPrivate *si) { jack_latency_callback_mode_t latency_mode = (aim == SoundIoDeviceAimOutput) ? JackPlaybackLatency : JackCaptureLatency; jack_port_get_latency_range(jport, latency_mode, &port->latency_range); - - port_name_ptr += 1; } for (int i = 0; i < clients.length; i += 1) {