lib: save and restore current thread error when calling destruction listeners and...
[babeltrace.git] / src / lib / graph / iterator.c
index 49381a3ca9f69dcb4d21c7cd4520462053380726..a0a88199a0627c8a1eb6cf335f242c4700b9bf4d 100644 (file)
@@ -226,9 +226,17 @@ void bt_self_component_port_input_message_iterator_try_finalize(
        }
 
        if (method) {
+               const bt_error *saved_error;
+
+               saved_error = bt_current_thread_take_error();
+
                BT_LIB_LOGD("Calling user's finalization method: %!+i",
                        iterator);
                method(iterator);
+
+               if (saved_error) {
+                       BT_CURRENT_THREAD_MOVE_ERROR_AND_RESET(saved_error);
+               }
        }
 
        /* Detach upstream message iterators */
This page took 0.024567 seconds and 4 git commands to generate.