lib: graph API: remove "listener removed" callback parameters
[babeltrace.git] / src / bindings / python / bt2 / bt2 / graph.py
index b1d59700c8cc100c50d3c28809d82edf7495cf04..a3926e5951ff14df902f47c5b5203281bad27cbd 100644 (file)
@@ -57,6 +57,10 @@ class Graph(object._SharedObject):
 
         super().__init__(ptr)
 
+        # list of listener partials to keep a reference as long as
+        # this graph exists
+        self._listener_partials = []
+
     def add_component(
         self,
         component_class,
@@ -140,6 +144,9 @@ class Graph(object._SharedObject):
         if listener_ids is None:
             raise bt2._Error('cannot add listener to graph object')
 
+        # keep the partial's reference
+        self._listener_partials.append(listener_from_native)
+
     def run_once(self):
         status = native_bt.graph_run_once(self._ptr)
         utils._handle_func_status(status, 'graph object could not run once')
This page took 0.02338 seconds and 4 git commands to generate.