Closed cnheitman closed 1 month ago
Mmmh, I remember adding these INC_REF
due to a bad counting. I think that's why unit tests segfault =/
I'm checking the tests to understand better what's going on.
Here is the commit that added these INC
. Maybe it can help you. https://github.com/JonathanSalwan/Triton/commit/23f5c21db414513194ace26358b386fc409e24bb
I updated the PR. Now tests pass (at least locally), and I'm not getting the nanobind leak messages when using Triton with LIEF v0.14.1. It does not seem necessary to increase the refs in addCallback
as the are "borrowed" refs and, in a similar way, they don't need to be decreased in removeCallback
.
Let's wait until all tests run and see what happens.
Fix PR fixes a small memory leak in the
addCallback
function. This issue was spotted than to LIEF and their new nanobind implementation of its Python bindings (ref here).