From 3aceeca43c570225b10c5b1c383332790d5674b6 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Sun, 23 Jul 2006 00:33:55 +0000 Subject: [PATCH] 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 --- src/core/automation_editor.cpp | 6 +++++- src/core/note_play_handle.cpp | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/core/automation_editor.cpp b/src/core/automation_editor.cpp index 1f5bd4eb7..7efc21c55 100644 --- a/src/core/automation_editor.cpp +++ b/src/core/automation_editor.cpp @@ -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(); diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index b157e3613..d87720459 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -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 {