Fix: lib: prevent infinite recursion when destroying trace classes and traces
When implementing support for trace and trace class destruction
listeners in Python, we hit a problem where we enter infinite recursion
(until the process crashes).
When the refcount of a trace class reaches 0, the destruction listeners
for that trace class are called. The Python listener creates a
TraceClass object, which acquires a new reference to the trace class
being destroyed. When the listener is done, it drops that reference.
This causes the refcount to reach 0 again, and the lib to call all the
destruction listeners again.
The same happens for traces.
To prevent it, this patch makes the lib increment the refcount by one
before calling all destruction listeners.
Change-Id: Ib7e7bd0428c2a505fb25ad0aa80150b518da4c4e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1282
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.026374 seconds and 4 git commands to generate.