Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix tests built with PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 5 Jan 2023 15:44:08 +0000 (16:44 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 5 Jan 2023 15:48:17 +0000 (16:48 +0100)
commit2c2d94471739d82e9cbd370711f73377e0b17717
tree1adf6e658716b65921f44a93873c49ca4625f190
parentdceab8b71c8382af486299462333c8f389ed5e41
Fix tests built with PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF.

There was more (hidden) calls to inc_ref/dec_ref while the GIL was not held.

All of them are lambdas used as callbacks with a captured py::object.
As a workaround, the reference counter is increased before releasing the GIL,
and the lambda simply captures the raw pointers.

For more details, see the release notes for pybind11 versions 2.10.2, 2.10.3,
and the future 2.11.
src/bindings/python/simgrid_python.cpp