lib: do not allow port to be removed when message iterators are active
[babeltrace.git] / lib / graph / component.c
index eb9118613750027fe4279444fbce3fce7bc536a3..841931270163110277f19d370c4cf727d35fdd95 100644 (file)
@@ -38,7 +38,7 @@
 #include <babeltrace/graph/component-sink-internal.h>
 #include <babeltrace/graph/connection-internal.h>
 #include <babeltrace/graph/graph-internal.h>
-#include <babeltrace/graph/notification-iterator-internal.h>
+#include <babeltrace/graph/message-iterator-internal.h>
 #include <babeltrace/graph/port-internal.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/compiler-internal.h>
@@ -267,7 +267,6 @@ int bt_component_create(struct bt_component_class *component_class,
        BT_ASSERT(user_component);
        BT_ASSERT(component_class);
        BT_ASSERT(name);
-
        type = bt_component_class_get_type(component_class);
        BT_LIB_LOGD("Creating empty component from component class: %![cc-]+C, "
                "comp-name=\"%s\"", component_class, name);
@@ -278,8 +277,7 @@ int bt_component_create(struct bt_component_class *component_class,
                goto end;
        }
 
-       bt_object_init_shared_with_parent(&component->base,
-               destroy_component);
+       bt_object_init_shared_with_parent(&component->base, destroy_component);
        component->class = component_class;
        bt_object_get_no_null_check(component->class);
        component->destroy = component_destroy_funcs[type];
@@ -483,7 +481,7 @@ void remove_port_by_index(struct bt_component *component,
         * below (in which its component is `NULL` as expected because
         * of the bt_object_set_parent() call below).
         *
-        * To avoid a destroyed port during the notification callback,
+        * To avoid a destroyed port during the message callback,
         * get a reference now, and put it (destroying the port if its
         * reference count is 0 at this point) after notifying the
         * graph's user.
@@ -547,8 +545,7 @@ void bt_component_remove_port(struct bt_component *component,
                struct bt_port *cur_port = g_ptr_array_index(ports, i);
 
                if (cur_port == port) {
-                       remove_port_by_index(component,
-                               ports, i);
+                       remove_port_by_index(component, ports, i);
                        goto end;
                }
        }
This page took 0.025431 seconds and 4 git commands to generate.