fix crash caused by closing down JACK but not telling JACK_MidiPorts about it
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 30 Dec 2009 02:58:57 +0000 (02:58 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 30 Dec 2009 02:58:57 +0000 (02:58 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6412 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audioengine.cc
libs/midi++2/jack_midiport.cc

index 634d62cc0b2f1b7d42174d7d0759dc7e00ac02f6..322365fb9f6783fe5f117fc9287125a7e6be62e6 100644 (file)
@@ -228,6 +228,7 @@ AudioEngine::stop (bool forever)
                } else {
                        jack_deactivate (_priv_jack);
                        Stopped(); /* EMIT SIGNAL */
+                       MIDI::JACK_MidiPort::JackHalted (); /* EMIT SIGNAL */
                }
        }
 
@@ -918,6 +919,7 @@ AudioEngine::halted (void *arg)
 
        if (was_running) {
                ae->Halted(); /* EMIT SIGNAL */
+               MIDI::JACK_MidiPort::JackHalted (); /* EMIT SIGNAL */
        }
 }
 
@@ -1182,6 +1184,7 @@ AudioEngine::disconnect_from_jack ()
        if (_running) {
                _running = false;
                Stopped(); /* EMIT SIGNAL */
+               MIDI::JACK_MidiPort::JackHalted (); /* EMIT SIGNAL */
        }
 
        return 0;
index 35e9ade1a3f1cb59b94987079782f4938bdca34e..b944a19ea6d02c30e9db883ae6b4041cb01c83ea 100644 (file)
@@ -293,7 +293,7 @@ JACK_MidiPort::get_state () const
        XMLNode& root (Port::get_state ());
 
        if (_jack_output_port) {
-
+               
                const char** jc = jack_port_get_connections (_jack_output_port);
                string connection_string;
                if (jc) {
@@ -305,10 +305,14 @@ JACK_MidiPort::get_state () const
                        }
                        free (jc);
                }
-
+               
                if (!connection_string.empty()) {
                        root.add_property ("outbound", connection_string);
                }
+       } else {
+               if (!_outbound_connections.empty()) {
+                       root.add_property ("outbound", _outbound_connections);
+               }
        }
 
        if (_jack_input_port) {
@@ -328,6 +332,10 @@ JACK_MidiPort::get_state () const
                if (!connection_string.empty()) {
                        root.add_property ("inbound", connection_string);
                }
+       } else {
+               if (!_inbound_connections.empty()) {
+                       root.add_property ("inbound", _inbound_connections);
+               }
        }
 
        return root;