Don't allow to add/remove monitor-section w/o engine

Adding/removing the Monitor section changes port-connections,
a port-engine is needed to establish connections.

Ideally we'd allow this and queue for connection changes. This
will however require deep changes.

Also toggling the monitor-section on/off/on w/o engine can later
result in failure to register ports. Due to lack of engine-signals
not all shared_ptr<> port references are dropped.
This commit is contained in:
Robin Gareus 2018-11-26 03:06:22 +01:00
parent 13c984c216
commit ae2a6175cc
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 11 additions and 0 deletions

View File

@ -1161,6 +1161,12 @@ Session::remove_monitor_section ()
return;
}
/* allow deletion when session is unloaded */
if (!_engine.running() && !(_state_of_the_state & Deletion)) {
error << _("Cannot remove monitor section while the engine is offline.") << endmsg;
return;
}
/* force reversion to Solo-In-Place */
Config->set_solo_control_is_listen_control (false);
@ -1217,6 +1223,11 @@ Session::add_monitor_section ()
{
RouteList rl;
if (!_engine.running()) {
error << _("Cannot create monitor section while the engine is offline.") << endmsg;
return;
}
if (_monitor_out || !_master_out || Profile->get_trx()) {
return;
}