aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2021-06-03 13:14:08 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-06-03 13:26:36 -0500
commitff0cf9b4331c39b97b525eaa12f4e073ca4a8290 (patch)
tree4d4b39cb0d53efc71cb130047d4863b680bb0540
parentda46dddbebab2ddb1f25f2f200431c2299b395f4 (diff)
downloaduhd-ff0cf9b4331c39b97b525eaa12f4e073ca4a8290.tar.gz
uhd-ff0cf9b4331c39b97b525eaa12f4e073ca4a8290.tar.bz2
uhd-ff0cf9b4331c39b97b525eaa12f4e073ca4a8290.zip
rfnoc: Fix post action behavior of nodes
When a node has an action callback assigned this must be cleared along with the block removal. Otherwise a post action callback might try to modify node that are already removed which results in an undefined behavior. In particular this one fixes the Unexpected error [ERROR] [CTRLEP] Caught exception during async message handling: map::at when running the multi_usrp_test.py
-rw-r--r--host/lib/rfnoc/graph.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/host/lib/rfnoc/graph.cpp b/host/lib/rfnoc/graph.cpp
index 92cf9e8bf..931777629 100644
--- a/host/lib/rfnoc/graph.cpp
+++ b/host/lib/rfnoc/graph.cpp
@@ -212,6 +212,8 @@ void graph_t::disconnect(node_ref_t src_node, node_ref_t dst_node, graph_edge_t
UHD_LOG_TRACE(LOG_ID,
"Removing block " << src_node->get_unique_id() << ":" << edge_info.src_port);
node_accessor.clear_resolve_all_callback(src_node);
+ node_accessor.set_post_action_callback(
+ src_node, [](const res_source_info&, action_info::sptr) {});
}
// Re-look up the vertex descriptor for dst_node, as the act of removing
@@ -222,6 +224,8 @@ void graph_t::disconnect(node_ref_t src_node, node_ref_t dst_node, graph_edge_t
UHD_LOG_TRACE(LOG_ID,
"Removing block " << dst_node->get_unique_id() << ":" << edge_info.dst_port);
node_accessor.clear_resolve_all_callback(dst_node);
+ node_accessor.set_post_action_callback(
+ dst_node, [](const res_source_info&, action_info::sptr) {});
}
}