Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There was a segmentation fault bug that happened if a project file was loaded and one of the tracks had a Knob set to a different value. That would trigger a processCCEvent call while the Track was still being loaded, which then would call processInEvent. At the moment processInEvent was called, m_instrument was still NULL, so instrument()->handleMidiEvent caused LMMS to crash. To fix this two measures were taken: 1) Added a sanity check on processInEvent, so it only calls handleMidiEvent if m_instrument is not NULL. 2) During the track being loaded (InstrumentTrack::loadTrackSpecificSettings), we first set m_midiCCEnable to false, so the Knob value changes don't trigger processInEvent calls, then load all knob models and finally load the correct value of m_midiCCEnable. Also added a comment on the InstrumentTrack constructor explaining why the MIDI CC models need to be created before setName (to avoid the position being changed later and a mysterious Segmentation Fault being caused by consequence).
- Loading branch information