mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-27 07:32:02 +00:00
cca4c51ca4
`PyUnicode_DecodeLatin1` requires you to pass in the `error` parameter. The code as it is in the docs didn't compile. There is a reference leak in the example code. `PyUnicode_DecodeLatin1` returns a new reference. Calling `py::str(PyObject*)` calls `PyObject_Str`, which also returns a new reference. That reference is managed by the `py::str` constructor (which correctly steals the reference, using the `stolen_t` constructor), but the original reference returned by `PyUnicode_DecodeLatin1` is never decref'd: it never makes it into an `object`, and it's never manually decremented. This fixes both of those issues. The code compiles, and I viewed the sphinx docs locally. |
||
---|---|---|
.. | ||
chrono.rst | ||
custom.rst | ||
eigen.rst | ||
functional.rst | ||
index.rst | ||
overview.rst | ||
stl.rst | ||
strings.rst |