fix crash during first-run configuration of the application, caused by using an incom...
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 3 Nov 2018 01:36:53 +0000 (21:36 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 3 Nov 2018 01:52:00 +0000 (21:52 -0400)
libs/ardour/ardour/transport_master_manager.h
libs/ardour/rc_configuration.cc
libs/ardour/transport_master_manager.cc

index 46d195bf244fc8ea814eab60883eacf1050c4b6e..5ed3855eb2200ceafb50d44b7f2452ac6ac43c56 100644 (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;
 
index c558be8b084b69fd57e1a39b7411b6707678a9ec..3227a644dde5c10f80c48416a43264668c1e5865 100644 (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;
 }
index 063224632c2dc8d3740b239ed04570770a8ca01f..6354dff05ce3c53d7a207c11218cc7e9ce64f7cd 100644 (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);