Fix: add_component_with_init_method_data(): freeze parameters
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 20 Mar 2019 20:59:28 +0000 (16:59 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:38 +0000 (18:19 -0400)
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 <eeppeliteloop@gmail.com>
lib/graph/graph.c

index 29ebee34d545a49f7bfacb52c558233c05c375ce..b7d04b0a674b2d8fb44aa7659e9bc44e440206ca 100644 (file)
@@ -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.");
This page took 0.024786 seconds and 4 git commands to generate.