Skip to content

Commit

Permalink
fix crashes and isClearing
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Dec 11, 2024
1 parent be50fe8 commit 21e8c71
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Modules/juce_organicui
2 changes: 1 addition & 1 deletion Modules/juce_timeline
10 changes: 5 additions & 5 deletions Source/Common/Processor/Mapping/Input/MappingInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,28 @@ StandardMappingInput::StandardMappingInput(var params, Multiplex* processor) :

StandardMappingInput::~StandardMappingInput()
{
if (list != nullptr) list->removeMultiplexListListener(this);
if (list != nullptr && !list->isClearing) list->removeMultiplexListListener(this);
}

void StandardMappingInput::lockInput(Parameter* input)
{
setInput(input);
if (input != nullptr) inputTarget->setEnabled(false);
if (input != nullptr && !list->isClearing) inputTarget->setEnabled(false);
}


void StandardMappingInput::setList(BaseMultiplexList* newList)
{
if (newList == list) return;

if (list != nullptr)
if (list != nullptr && !list->isClearing)
{
list->removeMultiplexListListener(this);
}

list = newList;

if (list != nullptr)
if (list != nullptr && !list->isClearing)
{
list->addMultiplexListListener(this);
}
Expand All @@ -146,7 +146,7 @@ void StandardMappingInput::setList(BaseMultiplexList* newList)
Parameter* StandardMappingInput::getInputAt(int multiplexIndex)
{
if (!multiplexListMode) return MappingInput::getInputAt(multiplexIndex);
return dynamic_cast<Parameter*>(list != nullptr ? list->getTargetControllableAt(multiplexIndex) : nullptr);
return dynamic_cast<Parameter*>(list != nullptr && !list->isClearing ? list->getTargetControllableAt(multiplexIndex) : nullptr);
}


Expand Down

0 comments on commit 21e8c71

Please sign in to comment.