bt_port_output_message_iterator_create(): check that graph has no sinks
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 19 Mar 2019 18:39:17 +0000 (14:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:38 +0000 (18:19 -0400)
The graph must not have any sink component when calling
bt_port_output_message_iterator_create() because the purpose of an
output port message iterator is to iterator the messages of a source or
a filter component.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
lib/graph/iterator.c

index 01c21128e84c69ea3cb7ac3d598e55d96aa0093f..11f17dcdea31d1e2b7371205ef362f39ec1f6fd4 100644 (file)
@@ -750,6 +750,8 @@ bt_port_output_message_iterator_create(struct bt_graph *graph,
                (void *) graph,
                "Output port is not part of graph: %![graph-]+g, %![port-]+p",
                graph, output_port);
+       BT_ASSERT_PRE(!graph->has_sink,
+               "Graph already has a sink component: %![graph-]+g");
 
        /* Create message iterator */
        BT_LIB_LOGD("Creating message iterator on output port: "
This page took 0.02507 seconds and 4 git commands to generate.