Fix crash when there are no ports at all.

git-svn-id: file:///home/vcs/svn/jsweeper/trunk@45 6611ac79-6612-48ef-a1e9-b906f853523e
master
petern 2011-01-27 21:56:18 +00:00
parent caa3daeb5e
commit 4cad6b8ff8
1 changed files with 6 additions and 4 deletions

View File

@ -42,11 +42,13 @@ void PortManager::Refresh()
const char **ports = jack_get_ports(client, NULL, NULL, 0);
for (int i = 0; ports[i] != NULL; ++i) {
Add(jack_port_by_name(client, ports[i]));
}
if (ports != NULL) {
for (int i = 0; ports[i] != NULL; ++i) {
Add(jack_port_by_name(client, ports[i]));
}
jack_free(ports);
jack_free(ports);
}
RefreshConnections();
}