• Tailing Yuan's avatar
    fix: memory leak in cpp_function (#3228) (#3229) · d6474ed7
    Tailing Yuan authored
    
    
    * fix: memory leak in cpp_function (#3228)
    
    * add a test case to check objects are deconstructed in cpp_function
    
    * update the test case about cpp_function
    
    * fix the test case about cpp_function: remove "noexcept"
    
    * Actually calling func. CHECK(stat.alive() == 2); Manually verified that the new tests fails without the change in pybind11.h
    
    * Moving new test to test_callbacks.cpp,py, with small enhancements.
    
    * Removing new test from test_interpreter.cpp (after it was moved to test_callbacks.cpp,py). This restores test_interpreter.cpp to the current state on master.
    
    * Using py::detail::silence_unused_warnings(py_func); to make the intent clear.
    Co-authored-by: default avatarRalf W. Grosse-Kunstleve <rwgk@google.com>
    d6474ed7
test_callbacks.cpp 8.73 KB