mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-03 04:13:43 -04:00
* instantly exit noteOff() if already released
* manually unlink references to itself in instrumentTrack (fixes segfaults in various situations) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1278 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -116,10 +116,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
|
||||
|
||||
notePlayHandle::~notePlayHandle()
|
||||
{
|
||||
if( m_released == FALSE )
|
||||
{
|
||||
noteOff( 0 );
|
||||
}
|
||||
noteOff( 0 );
|
||||
|
||||
if( m_baseNote )
|
||||
{
|
||||
@@ -127,6 +124,11 @@ notePlayHandle::~notePlayHandle()
|
||||
m_instrumentTrack->m_processHandles.removeAll( this );
|
||||
}
|
||||
|
||||
if( m_instrumentTrack->m_notes[key()] == this )
|
||||
{
|
||||
m_instrumentTrack->m_notes[key()] = NULL;
|
||||
}
|
||||
|
||||
if( m_pluginData != NULL )
|
||||
{
|
||||
m_instrumentTrack->deleteNotePluginData( this );
|
||||
@@ -287,6 +289,11 @@ bool notePlayHandle::isFromTrack( const track * _track ) const
|
||||
|
||||
void notePlayHandle::noteOff( const f_cnt_t _s )
|
||||
{
|
||||
if( m_released )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// first note-off all sub-notes
|
||||
for( notePlayHandleVector::iterator it = m_subNotes.begin();
|
||||
it != m_subNotes.end(); ++it )
|
||||
|
||||
Reference in New Issue
Block a user