fix crash during first-run configuration of the application, caused by using an incomplete TransportMasterManager

This commit is contained in:
Paul Davis 2018-11-02 21:36:53 -04:00
parent c04fc2efe2
commit bf2d9e7a34
3 changed files with 8 additions and 2 deletions

View file

@ -38,6 +38,7 @@ class LIBARDOUR_API TransportMasterManager : public boost::noncopyable
int init ();
static TransportMasterManager& instance();
static bool exists() { return _instance != 0; }
typedef std::list<boost::shared_ptr<TransportMaster> > TransportMasters;

View file

@ -189,7 +189,10 @@ RCConfiguration::get_state ()
}
root->add_child_nocopy (ControlProtocolManager::instance().get_state());
root->add_child_nocopy (TransportMasterManager::instance().get_state());
if (TransportMasterManager::exists()) {
root->add_child_nocopy (TransportMasterManager::instance().get_state());
}
return *root;
}

View file

@ -522,7 +522,9 @@ TransportMasterManager::get_state ()
{
XMLNode* node = new XMLNode (state_node_name);
node->set_property (X_("current"), _current_master->name());
if (_current_master) {
node->set_property (X_("current"), _current_master->name());
}
Glib::Threads::RWLock::ReaderLock lm (lock);