fix crash with missing .mid
authorRobin Gareus <robin@gareus.org>
Fri, 28 Aug 2015 16:48:40 +0000 (18:48 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 28 Aug 2015 16:48:40 +0000 (18:48 +0200)
assert in ARDOUR::MidiRegion::control() boost::shared_ptr<ARDOUR::MidiModel>::operator-> invalid ptr.
see http://pastebin.com/dTV10Zu6

libs/ardour/midi_track.cc

index 6d7b4519c52010533cc6c21b30ee092015fb6eb0..fc1ab21b53d2cee7c048febcf185bd5c60082249 100644 (file)
@@ -513,6 +513,11 @@ MidiTrack::non_realtime_locate (framepos_t pos)
                return;
        }
 
+       /* the source may be missing, but the control still referenced in the GUI */
+       if (!region->midi_source() || !region->model()) {
+               return;
+       }
+
        Glib::Threads::Mutex::Lock lm (_control_lock, Glib::Threads::TRY_LOCK);
        if (!lm.locked()) {
                return;