You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to store a Python callback within a C++ object so that it can be invoked later but am noticing that the containing class is not properly destroyed on cleanup. The destructor for Container is never run, but only when the Python callback object is copied into the container. Using a reference or pointer member variable for the Python callback object appears to avoid this issue,
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
741d86f
Problem description
I'm trying to store a Python callback within a C++ object so that it can be invoked later but am noticing that the containing class is not properly destroyed on cleanup. The destructor for Container is never run, but only when the Python callback object is copied into the container. Using a reference or pointer member variable for the Python callback object appears to avoid this issue,
Reproducible example code
The following works correctly,
Container::~Container()
is runIs this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: