fixed nasty memory bug in pybind11, appearing only with python 2.7 but also potentially affecting 3.x

This commit is contained in:
Daniele Panozzo
2015-09-14 16:55:34 +02:00
parent b25ed574a2
commit d23c0b6c9b
2 changed files with 21 additions and 25 deletions
+20 -24
View File
@@ -53,19 +53,16 @@ m.def("slice", []
}, __doc_igl_slice,
py::arg("X"), py::arg("R"), py::arg("Y"));
// // TODO: problematic!
// m.def("slice", []
// (
// const Eigen::MatrixXd& X,
// const Eigen::MatrixXi& R
// )
// {
// std::cerr << "Maybe also here?" << std::endl;
// // assert_is_VectorX("R",R);
// // return igl::slice(X,R);
// return;
// }, __doc_igl_slice,
// py::arg("X"), py::arg("R"));
m.def("slice", []
(
const Eigen::MatrixXd& X,
const Eigen::MatrixXi& R
)
{
assert_is_VectorX("R",R);
return igl::slice(X,R);
}, __doc_igl_slice,
py::arg("X"), py::arg("A"));
m.def("slice", []
(
@@ -134,17 +131,16 @@ m.def("slice", []
}, __doc_igl_slice,
py::arg("X"), py::arg("R"), py::arg("Y"));
// TODO: Problematic
// m.def("slice", []
// (
// const Eigen::MatrixXi& X,
// const Eigen::MatrixXi& R
// )
// {
// assert_is_VectorX("R",R);
// return igl::slice(X,R);
// }, __doc_igl_slice,
// py::arg("X"), py::arg("R"));
m.def("slice", []
(
const Eigen::MatrixXi& X,
const Eigen::MatrixXi& R
)
{
assert_is_VectorX("R",R);
return igl::slice(X,R);
}, __doc_igl_slice,
py::arg("X"), py::arg("R"));
m.def("slice", []
(