rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
698 stars 342 forks source link

steal reference count when constructing pybind11::object for PyUnicode_Decode #1212

Closed cielavenir closed 1 year ago

cielavenir commented 1 year ago

According to https://docs.python.org/2.7/c-api/unicode.html#c.PyUnicode_Decode , PyUnicode_Decode returns New reference. Meanwhile, pybind11::object internally increases the reference count when constructed. It seems like the latter causes double-increasing. To disable auto-increasing reference count, we should use py::reinterpret_steal.

This can also be said to handle_to_object, whose user is PyInt_FromLong.

cielavenir commented 1 year ago

Pipeline #508207

pipelineid=343554

cielavenir commented 1 year ago

appendix