Browse Source

Fix Engine::removeCable() not updating inputCablesCache.

tags/v2.5.0
Andrew Belt 7 months ago
parent
commit
8f092af042
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/engine/Engine.cpp

+ 1
- 2
src/engine/Engine.cpp View File

@@ -373,7 +373,6 @@ static void Engine_stepFrame(Engine* that) {
// Sum all outputs to input value // Sum all outputs to input value
for (Cable* cable : cables) { for (Cable* cable : cables) {
Output* output = &cable->outputModule->outputs[cable->outputId]; Output* output = &cable->outputModule->outputs[cable->outputId];
Input* input = &cable->inputModule->inputs[cable->inputId];


auto finitize = [](float x) { auto finitize = [](float x) {
return std::isfinite(x) ? x : 0.f; return std::isfinite(x) ? x : 0.f;
@@ -983,7 +982,7 @@ void Engine::removeCable_NoLock(Cable* cable) {
assert(it != internal->cables.end()); assert(it != internal->cables.end());
// Remove cable caches // Remove cable caches
{ {
auto v = internal->inputCablesCache[&input];
auto& v = internal->inputCablesCache[&input];
auto it = std::find(v.begin(), v.end(), cable); auto it = std::find(v.begin(), v.end(), cable);
assert(it != v.end()); assert(it != v.end());
v.erase(it); v.erase(it);


Loading…
Cancel
Save