Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
enum bt_component_class_type type;
struct bt_port *default_port = NULL;
+ bt_get(params);
+
if (!component_class) {
goto end;
}
goto end;
}
+ /*
+ * Parameters must be a map value, but we create a convenient
+ * empty one if it's NULL.
+ */
+ if (params) {
+ if (!bt_value_is_map(params)) {
+ goto end;
+ }
+ } else {
+ params = bt_value_map_create();
+ if (!params) {
+ goto end;
+ }
+ }
+
component = component_create_funcs[type](component_class, params);
if (!component) {
goto end;
bt_component_class_freeze(component->class);
end:
+ bt_put(params);
bt_put(default_port);
return component;
}