From c5ab13e5c54bfbfb54d799a1b7e9f8bdacb0515d Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 26 Jan 2014 09:46:20 +0100 Subject: [PATCH] InstrumentTrack: check for instrument instance in processOutEvent() There are situations where processOutEvent() is being called while loading instrument track settings e.g. when loading the pitch model whose dataChanged() signal is connected to InstrumentTrack::updatePitch() which in turn calls processOutEvent(). At this time we do not have an instrument instance and therefore have to skip processing. Closes #164. --- src/tracks/InstrumentTrack.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index aee0c8710..8cd840ced 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -356,6 +356,12 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti void InstrumentTrack::processOutEvent( const MidiEvent& event, const MidiTime& time ) { + // do nothing if we do not have an instrument instance (e.g. when loading settings) + if( m_instrument == NULL ) + { + return; + } + const MidiEvent transposedEvent = applyMasterKey( event ); const int key = transposedEvent.key();