mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-28 17:37:41 +01:00
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:
parent
5219cb7cd6
commit
edf09354fb
1 changed files with 9 additions and 5 deletions
|
|
@ -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 ());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue