Merge pull request #225 from wongcc966422/issue220

Fixes crash when opening file with Peak Controller
This commit is contained in:
Tobias Doerffel
2014-02-01 03:45:11 -08:00
6 changed files with 128 additions and 9 deletions

View File

@@ -48,6 +48,11 @@ public:
return m_lastSample;
}
PeakController * controller()
{
return m_autoController;
}
int m_effectId;
private:
@@ -57,7 +62,7 @@ private:
float m_lastRMS;
bool m_lastRMSavail;
Controller * m_autoController;
PeakController * m_autoController;
friend class PeakControllerEffectControls;

View File

@@ -49,6 +49,7 @@ PeakControllerEffectControls( PeakControllerEffect * _eff ) :
void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
{
m_baseModel.loadSettings( _this, "base" );
@@ -77,7 +78,7 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
m_effect->m_effectId = rand();
}
if( m_effect->m_autoController && ( engine::getSong()->isLoadingProject() == true || PresetPreviewPlayHandle::isPreviewing() == false ) )
if( m_effect->m_autoController && PresetPreviewPlayHandle::isPreviewing() == false )
{
delete m_effect->m_autoController;
m_effect->m_autoController = 0;