Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/effects/backends/effectprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ class EffectProcessorImpl : public EffectProcessor {
const EffectEnableState enableState,
const GroupFeatureState& groupFeatures) final {
EffectSpecificState* pState = m_channelStateMatrix[inputHandle][outputHandle];
// TODO: The state can be null if we are in the deleteStatesForInputChannel() loop.
// A protection against this is missing. Since it can happen the assertion is incorrect
// The memory will be leaked.
// Idea: Skip the processing here?
// Probably related: https://bugs.launchpad.net/mixxx/+bug/1775497
VERIFY_OR_DEBUG_ASSERT(pState != nullptr) {
if (kEffectDebugOutput) {
qWarning() << "EffectProcessorImpl::process could not retrieve"
Expand Down Expand Up @@ -268,6 +273,11 @@ class EffectProcessorImpl : public EffectProcessor {
// m_channelStateMatrix may be accessed concurrently in the audio
// engine thread in loadStatesForInputChannel.

// TODO: How is ensure that the statMap is not accessed during this loop?
// This is called in responds to DISABLE_EFFECT_CHAIN_FOR_INPUT_CHANNEL
// and it looks like that the objects pointed by m_channelStateMatrix
// may be still in use.
// Probably related: https://bugs.launchpad.net/mixxx/+bug/1775497
ChannelHandleMap<EffectSpecificState*>& stateMap =
m_channelStateMatrix[*inputChannel];
for (EffectSpecificState* pState : stateMap) {
Expand Down