Skip to content

Commit

Permalink
fix crash enabling PFL after an EffectState is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Jan 4, 2018
1 parent 52f54d4 commit 1ab3cb6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/engine/effects/engineeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ void EngineEffect::loadStatesForInputChannel(const ChannelHandle* inputChannel,
// Called from the main thread for garbage collection after an input channel is disabled
void EngineEffect::deleteStatesForInputChannel(const ChannelHandle* inputChannel) {
m_pProcessor->deleteStatesForInputChannel(inputChannel);
// If an output channel is not presently being processed, for example when
// PFL is not active, then EngineEffect::process cannot be relied upon to
// set the EffectEnableState from Disabling to Disabled. This must be done
// before the next time EngineEffect::process is called for that output
// channel, otherwise the EffectEnableState will still be in the intermediate
// Disabling state and EffectProcessorImpl::processChannel will try to run
// with an EffectState that has already been deleted and cause a crash.
// Refer to https://bugs.launchpad.net/mixxx/+bug/1741213
for (EffectEnableState& effectState : m_effectEnableStateForChannelMatrix[*inputChannel]) {
effectState = EffectEnableState::Disabled;
}
}

bool EngineEffect::processEffectsRequest(EffectsRequest& message,
Expand Down

0 comments on commit 1ab3cb6

Please sign in to comment.