Skip to content

Commit

Permalink
update connection_evaluator.h
Browse files Browse the repository at this point in the history
  • Loading branch information
phyBrackets authored Sep 20, 2023
1 parent 4981326 commit bdc4e01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/kdbindings/connection_evaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class ConnectionEvaluator
*/
void evaluateDeferredConnections()
{
std::list<std::function<void()>> copiedConnections;
std::list<std::function<void()>> movedConnections;
{
std::lock_guard<std::mutex> lock(connectionsMutex);
copiedConnections = std::move(connections);
movedConnections = std::move(connections);
// Reinitialize the connections list
connections = std::list<std::function<void()>>();
}

for (auto &connection : copiedConnections) {
for (auto &connection : movedConnections) {
connection();
}
}
Expand All @@ -67,4 +67,4 @@ class ConnectionEvaluator
std::list<std::function<void()>> connections;
std::mutex connectionsMutex;
};
} // namespace KDBindings
} // namespace KDBindings

0 comments on commit bdc4e01

Please sign in to comment.