Fix refcount bug introduced with PR #4916. (#4927)

https://github.com/pybind/pybind11/pull/4916/files#r1387035547
This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-11-08 11:16:10 -08:00 committed by GitHub
parent c758b81f3b
commit 2c35fde389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2759,7 +2759,6 @@ get_type_override(const void *this_ptr, const type_info *this_type, const char *
PyObject *self_arg = PyTuple_GET_ITEM(co_varnames, 0); PyObject *self_arg = PyTuple_GET_ITEM(co_varnames, 0);
Py_DECREF(co_varnames); Py_DECREF(co_varnames);
PyObject *self_caller = dict_getitem(locals, self_arg); PyObject *self_caller = dict_getitem(locals, self_arg);
Py_DECREF(locals);
if (self_caller == self.ptr()) { if (self_caller == self.ptr()) {
Py_DECREF(f_code); Py_DECREF(f_code);
Py_DECREF(frame); Py_DECREF(frame);