Document libbabeltrace2's C API
[babeltrace.git] / src / lib / graph / component.c
index d9f233eec4c0d3714f0e8cad4a6d0943aa03e9a1..65978e944cab83f5b1ce18f0070d437ee382ad2a 100644 (file)
 #include "lib/assert-pre.h"
 #include "lib/assert-post.h"
 #include <babeltrace2/graph/self-component.h>
-#include <babeltrace2/graph/component-const.h>
-#include <babeltrace2/graph/component-source-const.h>
-#include <babeltrace2/graph/component-filter-const.h>
-#include <babeltrace2/graph/component-sink-const.h>
-#include <babeltrace2/graph/graph-const.h>
+#include <babeltrace2/graph/component.h>
+#include <babeltrace2/graph/graph.h>
 #include "common/macros.h"
 #include "compat/compiler.h"
 #include <babeltrace2/types.h>
@@ -104,9 +101,18 @@ void finalize_component(struct bt_component *comp)
        }
 
        if (method) {
+               const struct bt_error *saved_error;
+
+               saved_error = bt_current_thread_take_error();
+
                BT_LIB_LOGI("Calling user's component finalization method: "
                        "%![comp-]+c", comp);
                method(comp);
+               BT_ASSERT_POST_NO_ERROR();
+
+               if (saved_error) {
+                       BT_CURRENT_THREAD_MOVE_ERROR_AND_RESET(saved_error);
+               }
        }
 }
 
@@ -553,6 +559,7 @@ bt_component_port_connected(
                        status == BT_FUNC_STATUS_MEMORY_ERROR,
                        "Unexpected returned component status: status=%s",
                        bt_common_func_status_string(status));
+               BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(status);
        }
 
        return status;
This page took 0.023428 seconds and 4 git commands to generate.