From 8f092af04287689ac7e88d92651fdb8cd0f381ff Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 13 Mar 2024 05:25:33 -0400 Subject: [PATCH] Fix Engine::removeCable() not updating inputCablesCache. --- src/engine/Engine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index cba83fc3..a1e1d2aa 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -373,7 +373,6 @@ static void Engine_stepFrame(Engine* that) { // Sum all outputs to input value for (Cable* cable : cables) { Output* output = &cable->outputModule->outputs[cable->outputId]; - Input* input = &cable->inputModule->inputs[cable->inputId]; auto finitize = [](float x) { return std::isfinite(x) ? x : 0.f; @@ -983,7 +982,7 @@ void Engine::removeCable_NoLock(Cable* cable) { assert(it != internal->cables.end()); // Remove cable caches { - auto v = internal->inputCablesCache[&input]; + auto& v = internal->inputCablesCache[&input]; auto it = std::find(v.begin(), v.end(), cable); assert(it != v.end()); v.erase(it);