13
0

don't crash during startup with no config files when trying to use a non-existent MIDI Manager object

git-svn-id: svn://localhost/ardour2/branches/3.0@7500 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-07-26 15:22:24 +00:00
parent 5219cb7cd6
commit edf09354fb

View File

@ -209,11 +209,15 @@ RCConfiguration::get_state ()
root = new XMLNode("Ardour");
const MIDI::Manager::PortList& ports = MIDI::Manager::instance()->get_midi_ports();
for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
root->add_child_nocopy((*i)->get_state());
}
MIDI::Manager* mm = MIDI::Manager::instance();
if (mm) {
const MIDI::Manager::PortList& ports = mm->get_midi_ports();
for (MIDI::Manager::PortList::const_iterator i = ports.begin(); i != ports.end(); ++i) {
root->add_child_nocopy((*i)->get_state());
}
}
root->add_child_nocopy (get_variables ());