Fix Python: Add a comment warning about an API limitation
[babeltrace.git] / bindings / python / babeltrace.i.in
index ee4ceccce13eeeeb27d45ce71076b725c9316231..4ead2980563f4534800f33f3f1d4a78810c2d316 100644 (file)
@@ -226,6 +226,17 @@ class TraceCollection:
                """
                Generator function to iterate over the events of open in the current
                TraceCollection.
+
+               Due to limitations of the native Babeltrace API, only one event
+               may be "alive" at a time (i.e. a user should never store a copy
+               of the events returned by this function for ulterior use). Users
+               shall make sure to copy the information they need from an event
+               before accessing the next one.
+
+               Furthermore, event objects become invalid when the generator goes
+               out of scope as the underlying iterator will be reclaimed. Using an
+               event after the the generator has gone out of scope may result in a
+               crash or data corruption.
                """
                begin_pos_ptr = _bt_iter_pos()
                end_pos_ptr = _bt_iter_pos()
This page took 0.023642 seconds and 4 git commands to generate.