diff options
author | Carl Hetherington <carl@carlh.net> | 2010-10-27 21:18:18 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-10-27 21:18:18 +0000 |
commit | 163dab0d5dcff76c5173b737b49e82c9af279c9f (patch) | |
tree | 2140bfb2818cda97dba4e5535e3d0dd5f31231be /libs/ardour/port.cc | |
parent | 935aeb55dd5fbce9fb9b1dd7770834b3b684a6d1 (diff) |
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
Diffstat (limited to 'libs/ardour/port.cc')
-rw-r--r-- | libs/ardour/port.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index efdd297f5e..4ae9b03c3b 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -51,6 +51,10 @@ Port::Port (std::string const & n, DataType t, Flags f) 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) { throw failed_constructor (); } |