From 53c79c5471b7627a9798d6a43a0cc5fdd8d60504 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 15 Apr 2008 22:32:44 +0000 Subject: [PATCH] check type of preview-play-handle via type() instead of blindly using dynamic_cast - probably fixes random crashes when previewing a lot of samples and presets git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@925 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 16 ++++++++++++++++ configure.in | 4 ++-- src/gui/file_browser.cpp | 7 ++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bedbc7b07..5c5504b28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-04-15 Tobias Doerffel + + * src/gui/file_browser.cpp: + check type of preview-play-handle via type() instead of blindly using + dynamic_cast - probably fixes random crashes when previewing a lot of + samples and presets + + * src/tracks/instrument_track.cpp: + delete instrument-instance *after* removing all play-handles from + mixer as several play-handle-methods rely on instrument - fixes crash + when removing track while playing + + * src/core/track.cpp: + directly delete view before removing model - fixes crash when + removing instrument-track with instrument-track-window open + 2008-04-15 Paul Giblock * plugins/stereo_matrix/stereomatrix_control_dialog.cpp: diff --git a/configure.in b/configure.in index b6bbdc13b..5a1a8e8dc 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.4.0-svn20080409, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080409) +AC_INIT(lmms, 0.4.0-svn20080415, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080415) AM_CONFIG_HEADER(config.h) diff --git a/src/gui/file_browser.cpp b/src/gui/file_browser.cpp index a9bc9d70c..34ac6cdb6 100644 --- a/src/gui/file_browser.cpp +++ b/src/gui/file_browser.cpp @@ -536,10 +536,11 @@ void listView::mouseReleaseEvent( QMouseEvent * _me ) { // if there're samples shorter than 3 seconds, we don't // stop them if the user releases mouse-button... - samplePlayHandle * s = dynamic_cast( - m_previewPlayHandle ); - if( s != NULL ) + if( m_previewPlayHandle->type() == + playHandle::SamplePlayHandle ) { + samplePlayHandle * s = dynamic_cast( + m_previewPlayHandle ); if( s->totalFrames() - s->framesDone() <= static_cast( engine::getMixer()->sampleRate() * 3 ) )