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
This commit is contained in:
@@ -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<samplePlayHandle *>(
|
||||
m_previewPlayHandle );
|
||||
if( s != NULL )
|
||||
if( m_previewPlayHandle->type() ==
|
||||
playHandle::SamplePlayHandle )
|
||||
{
|
||||
samplePlayHandle * s = dynamic_cast<samplePlayHandle *>(
|
||||
m_previewPlayHandle );
|
||||
if( s->totalFrames() - s->framesDone() <=
|
||||
static_cast<f_cnt_t>(
|
||||
engine::getMixer()->sampleRate() * 3 ) )
|
||||
|
||||
Reference in New Issue
Block a user