Skip to content

Commit

Permalink
- fix #422
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Hart committed Sep 12, 2023
1 parent 13f666f commit 841d3d5
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,15 @@ void dynamic::restoreConnections(Identifier id, var newValue)
if (safePtr.get() == nullptr)
return true;

auto ok = false;

if (id == PropertyIds::Value && safePtr->parentNode != nullptr)
{
auto ids = StringArray::fromTokens(newValue.toString(), ";", "");
ids.removeDuplicates(false);
ids.removeEmptyStrings(true);

auto network = safePtr->parentNode->getRootNetwork();

auto list = network->getListOfNodesWithPath(getReceiveId(), false);

for (auto n : list)
Expand All @@ -252,22 +253,22 @@ void dynamic::restoreConnections(Identifier id, var newValue)
{
source = safePtr.get();
source->connect(ro.as<dynamic_receive>());
return true;
ok = true;
}
else
{
if (source == safePtr.get())
{
source = &(ro.as<dynamic_receive>().null);
return true;
ok = true;
}

}
}
}
}

return false;
return ok;
};

parentNode->getRootNetwork()->addPostInitFunction(f);
Expand Down

0 comments on commit 841d3d5

Please sign in to comment.