bt2: free port user data when finalizing components
When creating component ports in Python, it is possible to pass a Python
object as user data:
class MySource(
bt2._UserSourceComponent, message_iterator_class=MyIter
):
def __init__(self, config, params, obj):
self._add_output_port('out', MyUserData())
The port takes a reference to this Python object, thanks to the `void *`
typemap in native_bt_port.i:
%typemap(out) void * {
Py_INCREF($1);
$result = $1;
}
However, this reference is never released.
This patches makes it so that when a component is finalized, it releases
the reference for the user data of all of its ports.
Change-Id: Ifebecc3b242c2ccf2bd65347a9087b90093f286c
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2734
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.026593 seconds and 4 git commands to generate.