Cancel the graph on destruction
[babeltrace.git] / 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.023578 seconds and 4 git commands to generate.