mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
* Fix leak in the test_copy_move::test_move_fallback * Fix leaking PyMethodDef in test_class::test_implicit_conversion_life_support * Plumb leak in test_buffer, occuring when a mutable buffer is requested for a read-only object, and enable test_buffer.py * Fix weird return_value_policy::reference in test_stl_binders, and enable those tests * Cleanup nodelete holder objects in test_smart_ptr, and enable those tests
This commit is contained in:
@@ -214,6 +214,7 @@ TEST_SUBMODULE(copy_move_policies, m) {
|
||||
};
|
||||
py::class_<MoveIssue2>(m, "MoveIssue2").def(py::init<int>()).def_readwrite("value", &MoveIssue2::v);
|
||||
|
||||
m.def("get_moveissue1", [](int i) { return new MoveIssue1(i); }, py::return_value_policy::move);
|
||||
// #2742: Don't expect ownership of raw pointer to `new`ed object to be transferred with `py::return_value_policy::move`
|
||||
m.def("get_moveissue1", [](int i) { return std::unique_ptr<MoveIssue1>(new MoveIssue1(i)); }, py::return_value_policy::move);
|
||||
m.def("get_moveissue2", [](int i) { return MoveIssue2(i); }, py::return_value_policy::move);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user