diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 7ab4b5977..02566b65c 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -867,7 +867,7 @@ void AutomationPattern::generateTangents() void AutomationPattern::generateTangents( timeMap::const_iterator it, int numToGenerate ) { - if( m_timeMap.size() < 2 ) + if( m_timeMap.size() < 2 && numToGenerate > 0 ) { m_tangents[it.key()] = 0; return; diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index 5685b46f6..90f6747f0 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -446,14 +446,14 @@ void EnvelopeAndLfoParameters::updateSampleVars() { sample_t * tmp = m_pahdEnv; m_pahdEnv = new sample_t[m_pahdFrames]; - delete tmp; + delete[] tmp; m_pahdBufSize = m_pahdFrames; } if( m_rBufSize < m_rFrames ) { sample_t * tmp = m_rEnv; m_rEnv = new sample_t[m_rFrames]; - delete tmp; + delete[] tmp; m_rBufSize = m_rFrames; } diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 91eb4e645..e15533cdf 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -911,7 +911,10 @@ void Song::loadProject( const QString & _file_name ) m_loadingProject = true; Engine::projectJournal()->setJournalling( false ); - Engine::mainWindow()->clearErrors(); + if( Engine::mainWindow() ) + { + Engine::mainWindow()->clearErrors(); + } m_fileName = _file_name; m_oldFileName = _file_name; @@ -1023,7 +1026,10 @@ void Song::loadProject( const QString & _file_name ) emit projectLoaded(); - Engine::mainWindow()->showErrors( tr( "The following errors occured while loading: " ) ); + if( Engine::mainWindow() ) + { + Engine::mainWindow()->showErrors( tr( "The following errors occured while loading: " ) ); + } m_loadingProject = false; m_modified = false;