Skip to content

Commit 4a72fae

Browse files
committed
Fix deadlock issue.
1 parent 82154f5 commit 4a72fae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Graph.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,16 @@ void Graph::AddNode(SharedNode node)
8484
{
8585
if (!node) return;
8686

87-
std::lock_guard _(_nodes_mutex);
87+
{
88+
std::lock_guard _(_nodes_mutex);
89+
_nodes.emplace(node->ID(), node);
90+
}
8891

8992
node->OnEmitOutput.Bind("PropagateConnectionsData",
9093
[this](const UUID& id, const IndexableName& key, SharedNodeData data) {
9194
this->PropagateConnectionsData(id, key, std::move(data));
9295
});
93-
9496
OnNodeAdded.Broadcast(node);
95-
_nodes.emplace(node->ID(), std::move(node));
9697
}
9798

9899
void Graph::RemoveNode(const SharedNode& node)

0 commit comments

Comments
 (0)