Skip to content

fix: refcount bug involving trampoline functions with PyObject * return type. #5156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 11, 2024
Prev Previous commit
Move PYBIND11_WARNING_POP for a better clang-format outcome.
  • Loading branch information
rwgk committed Jun 10, 2024
commit bd19ca143a073fb78532c37f9ccaee813a4518ff
3 changes: 2 additions & 1 deletion include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -2872,9 +2872,10 @@ function get_override(const T *this_ptr, const char *name) {
PYBIND11_WARNING_DISABLE_MSVC(4127) \
if (pybind11::detail::cast_is_temporary_value_reference<ret_type>::value \
&& !pybind11::detail::is_same_ignoring_cvref<ret_type, PyObject *>::value) { \
PYBIND11_WARNING_POP static pybind11::detail::override_caster_t<ret_type> caster; \
static pybind11::detail::override_caster_t<ret_type> caster; \
return pybind11::detail::cast_ref<ret_type>(std::move(o), caster); \
} \
PYBIND11_WARNING_POP \
return pybind11::detail::cast_safe<ret_type>(std::move(o)); \
} \
} while (false)
Expand Down
Loading