lib: save and restore current thread error when calling destruction listeners and...
[babeltrace.git] / src / lib / graph / component.c
index b5591c9eb4f48152eed3bb76e6ed80022d109a98..c771e27870cd15ca40ca27736ca794a55a836374 100644 (file)
@@ -104,9 +104,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);
+               }
        }
 }
 
This page took 0.024325 seconds and 4 git commands to generate.