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>
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);