Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #284, "fixed_step_algorithm crashes when a variable is reconnected" #285

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/cpp/algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class fixed_step_algorithm::impl
void disconnect_variable(variable_id input)
{
for (auto& s : simulators_) {
auto conns = s.second.outgoingConnections;
auto& conns = s.second.outgoingConnections;
const auto it = std::find_if(
conns.begin(),
conns.end(),
[input](const auto& c) { return c.input == input; });
conns.erase(it);
if (it != conns.end()) conns.erase(it);
}
}

Expand Down
Empty file modified test/cpp/fixed_step_algorithm_test.cpp
100644 → 100755
Empty file.