* 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:
Tobias Doerffel
2008-07-05 23:25:13 +00:00
parent d0e25e77f2
commit df6a874147

View File

@@ -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 )