[Summary] Fixed issue with crash when invalid get_connections request is made on invalid port handle.

get_connections() method is expected to return the amount of found connections. When port handle is invalid it returns -1 indicating an error.

if (_io->nth (n)->get_connections (connections) == 0) {
			if (!(*chan)->source.name.empty()) {
				// _source->disable_metering ();
			}
			(*chan)->source.name = string();
		} else {
			(*chan)->source.name = connections[0];
		}

-1 is the case which is not handled correctly here.
This commit is contained in:
GZharun 2014-08-31 13:05:42 +03:00
parent 9642bfaf1a
commit 295f361f5e

View file

@ -135,7 +135,12 @@ Port::get_connections (std::vector<std::string> & c) const
return c.size();
}
return port_engine.get_connections (_port_handle, c);
if (_port_handle) {
port_engine.get_connections (_port_handle, c);
return c.size();
}
return 0;
}
int