various minor fixes for crashes reported by nowhiskey

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3486 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-06-23 15:04:01 +00:00
parent 422607acfe
commit b52004a777
3 changed files with 37 additions and 23 deletions

View file

@ -1227,8 +1227,16 @@ AudioEngine::reconnect_to_jack ()
for (PortConnections::iterator i = port_connections.begin(); i != port_connections.end(); ++i) {
int err;
jack_client_t* j = _jack;
/* JACK could have zombified us. */
if (!j) {
error << _("Disconnected from JACK while reconnecting. You should quit Ardour now.") << endmsg;
return -1;
}
if ((err = jack_connect (_jack, (*i).first.c_str(), (*i).second.c_str())) != 0) {
if ((err = jack_connect (j, (*i).first.c_str(), (*i).second.c_str())) != 0) {
if (err != EEXIST) {
error << string_compose (_("could not reconnect %1 and %2 (err = %3)"),
(*i).first, (*i).second, err)