lib: graph API: remove "listener removed" callback parameters
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 11 Dec 2019 21:50:21 +0000 (16:50 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 12 Dec 2019 20:04:25 +0000 (20:04 +0000)
commitf3d6b4c2f7592fde9ff770989b25bacaa4820dc8
treee60915783e557ed7c8a59586677815fa2269875a
parent2945edfe752782d2528af21bdbd3bbfef4cd51ca
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.025354 seconds and 4 git commands to generate.