Cancel the graph on destruction
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 7 Jun 2017 22:12:03 +0000 (18:12 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 21:03:27 +0000 (17:03 -0400)
Consider the graph as canceled at the beginning of its destruction. This
prohibits the use of some operations that are restricted to be used when
the graph is active and running.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/graph/graph.c

index 10dd1944e840808e7b9669b9b8761deca26e590e..5b5acae75054b481ef6ec1b44f05a95b2b100530 100644 (file)
@@ -80,6 +80,12 @@ void bt_graph_destroy(struct bt_object *obj)
        BT_LOGD("Destroying graph: addr=%p", graph);
        obj->ref_count.count++;
 
+       /*
+        * Cancel the graph to disallow some operations, like creating
+        * notification iterators and adding ports to components.
+        */
+       (void) bt_graph_cancel(graph);
+
        if (graph->connections) {
                BT_LOGD_STR("Destroying connections.");
                g_ptr_array_free(graph->connections, TRUE);
This page took 0.024761 seconds and 4 git commands to generate.