lib: graph API: remove "listener removed" callback parameters
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 11 Dec 2019 21:50:21 +0000 (16:50 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 20 Jan 2020 20:15:24 +0000 (15:15 -0500)
commitfecbdb3e41100e97dc012ec599aeb33e20c8d795
tree8590a5e8882c15caf4e5524243d4bf1e3a3615c5
parentd9d764cc911fa4a1df6c611fd708ea3f41521275
lib: graph API: remove "listener removed" callback parameters

Before this patch, when you add a "port added" listener to a graph,
you can pass a callback which gets called when the listener is removed.
This only happens when the graph is destroyed.

This "listener removed" callback feature seems unnecessary as the graph
user, who adds the "port added" listener, has total control over the
graph object. Therefore she can ensure that anything needed by her "port
added" listeners exists as long as the graph exists.

Therefore this patch removes those parameters and everything related.

In Python, we used to keep a strong reference on the partial Python
object (listener's data) and release it when our "listener removed"
function was called. Now, the listener's data is a weak reference, but
we keep a list of strong partial references within the graph object
itself (`self._listener_partials`) to ensure that the partials exist as
long as the graph exists.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I4c06ff139740f887ae2ace7633d2edeb01fd2fa0
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2637
Tested-by: jenkins <jenkins@lttng.org>
include/babeltrace2/graph/graph.h
src/bindings/python/bt2/bt2/graph.py
src/bindings/python/bt2/bt2/native_bt_graph.i.h
src/cli/babeltrace2.c
src/lib/graph/graph.c
src/lib/graph/graph.h
tests/lib/test_graph_topo.c
This page took 0.025771 seconds and 4 git commands to generate.