From f433d1bfa7624c7a185f6a2ff843911a1f4cefab Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 20 Mar 2019 16:59:28 -0400 Subject: [PATCH] Fix: add_component_with_init_method_data(): freeze parameters In add_component_with_init_method_data(), an internal function called by all the bt_graph_add_*_component*() functions, the function must freeze the parameters value object (developer mode) in order to prevent further changes of this object (and its children), since at this point the object becomes shared with other users. Signed-off-by: Philippe Proulx --- lib/graph/graph.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/graph/graph.c b/lib/graph/graph.c index 29ebee34..b7d04b0a 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -1295,6 +1295,7 @@ enum bt_graph_status add_component_with_init_method_data( */ g_ptr_array_add(graph->components, component); bt_component_set_graph(component, graph); + bt_value_freeze(params); if (init_method) { BT_LOGD_STR("Calling user's initialization method."); -- 2.34.1