acquire play-handle-lock of mixer while calling noteOff() in instrumentTrack::processInEvent( ... ) - fixes asynchronously modifications of variables in notePlayHandle which led to segfaults in some cases
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@506 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,4 +1,12 @@
|
||||
2007-08-04 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
2007-08-03 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* src/tracks/instrument_track.cpp:
|
||||
acquire play-handle-lock of mixer while calling noteOff() in
|
||||
instrumentTrack::processInEvent( ... ) - fixes asynchronously
|
||||
modifications of variables in notePlayHandle which led to segfaults in
|
||||
some cases
|
||||
|
||||
2007-08-03 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/audio_file_processor/audio_file_processor.cpp:
|
||||
* plugins/bit_invader/bit_invader.cpp:
|
||||
|
||||
@@ -642,9 +642,10 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
}
|
||||
|
||||
case NOTE_OFF:
|
||||
if( m_notes[_me.key()] != NULL )
|
||||
{
|
||||
notePlayHandle * n = m_notes[_me.key()];
|
||||
if( n != NULL )
|
||||
{
|
||||
notePlayHandle * n = m_notes[_me.key()];
|
||||
// create dummy-note which has the same length
|
||||
// as the played note for sending it later
|
||||
// to all slots connected to signal noteDone()
|
||||
@@ -656,18 +657,25 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
engine::framesPerTact64th() ) ),
|
||||
0, n->tone(), n->octave(),
|
||||
n->getVolume(), n->getPanning() );
|
||||
// lock our play-handle while calling noteOff()
|
||||
// for not modifying it's member variables
|
||||
// asynchronously (while rendering!)
|
||||
// which can result in segfaults
|
||||
engine::getMixer()->lockPlayHandles();
|
||||
n->noteOff();
|
||||
engine::getMixer()->unlockPlayHandles();
|
||||
m_notes[_me.key()] = NULL;
|
||||
emit noteDone( done_note );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case KEY_PRESSURE:
|
||||
if( !m_instrument->handleMidiEvent( _me, _time ) &&
|
||||
m_notes[_me.key()] != NULL )
|
||||
{
|
||||
m_notes[_me.key()]->setVolume( _me.velocity() *
|
||||
100 / 128 );
|
||||
100 / 127 );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user