Prevent crash when trying to register a port with a disconnected engine.
git-svn-id: svn://localhost/ardour2/branches/3.0@7925 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
935aeb55dd
commit
163dab0d5d
@ -51,6 +51,10 @@ Port::Port (std::string const & n, DataType t, Flags f)
|
|||||||
|
|
||||||
assert (_name.find_first_of (':') == std::string::npos);
|
assert (_name.find_first_of (':') == std::string::npos);
|
||||||
|
|
||||||
|
if (!_engine->connected()) {
|
||||||
|
throw failed_constructor ();
|
||||||
|
}
|
||||||
|
|
||||||
if ((_jack_port = jack_port_register (_engine->jack (), _name.c_str (), t.to_jack_type (), _flags, 0)) == 0) {
|
if ((_jack_port = jack_port_register (_engine->jack (), _name.c_str (), t.to_jack_type (), _flags, 0)) == 0) {
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user