Add mixer lock to EffectChain::clear to prevent a race condition

This commit is contained in:
Fastigium
2016-02-16 13:31:17 +01:00
committed by Jesse Feddema
parent da8040764f
commit ca7c90a99c

View File

@@ -79,6 +79,8 @@ void EffectChain::loadSettings( const QDomElement & _this )
{
clear();
// TODO This method should probably also lock the mixer
m_enabledModel.setValue( _this.attribute( "enabled" ).toInt() );
const int plugin_cnt = _this.attribute( "numofeffects" ).toInt();
@@ -264,10 +266,14 @@ void EffectChain::clear()
{
emit aboutToClear();
Engine::mixer()->lock();
m_enabledModel.setValue( false );
for( int i = 0; i < m_effects.count(); ++i )
{
delete m_effects[i];
}
m_effects.clear();
Engine::mixer()->unlock();
}