added checks to avoid segfaults when closing the application

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@266 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2006-07-23 00:33:55 +00:00
parent b0e556781c
commit 3aceeca43c
2 changed files with 12 additions and 3 deletions

View File

@@ -1563,8 +1563,12 @@ void automationEditor::resizeEvent( QResizeEvent * )
m_topBottomScroll->setValue( m_scroll_level );
eng()->getSongEditor()->getPlayPos( songEditor::PLAY_AUTOMATION_PATTERN
if( eng()->getSongEditor() )
{
eng()->getSongEditor()->getPlayPos(
songEditor::PLAY_AUTOMATION_PATTERN
).m_timeLine->setFixedWidth( width() );
}
m_toolBar->setFixedWidth( width() );
updateTopBottomLevels();

View File

@@ -274,12 +274,17 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
FALSE );
}
// send MIDI-note-off-event
m_instrumentTrack->processOutEvent( midiEvent( NOTE_OFF,
// TODO: move framesPerTact() to engine
if( m_instrumentTrack->eng()->getSongEditor() )
{
m_instrumentTrack->processOutEvent( midiEvent( NOTE_OFF,
m_instrumentTrack->m_midiPort->outputChannel(),
key(), 0 ),
midiTime::fromFrames(
m_framesBeforeRelease,
m_instrumentTrack->eng()->getSongEditor()->framesPerTact() ) );
m_instrumentTrack->eng()->getSongEditor()
->framesPerTact() ) );
}
}
else
{