pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.08k stars 2.05k forks source link

[BUG]: 'static object' caused memory leak shown in asan & valgrind results. #5125

Open seulchanson opened 1 month ago

seulchanson commented 1 month ago

Required prerequisites

What version (or hash if on master) of pybind11 are you using?

pybind headonly 2.11.1

Problem description

image ![Uploading image.png…]()

image image

Reproducible example code

No response

Is this a regression? Put the last known working version here if it is.

Not a regression

seulchanson commented 1 month ago

If the function is executed and exits without doing anything, a memory leak will also occur.