From 2c35fde389aceaad1b5390313ebf77d36afb97e5 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 8 Nov 2023 11:16:10 -0800 Subject: [PATCH] Fix refcount bug introduced with PR #4916. (#4927) https://github.com/pybind/pybind11/pull/4916/files#r1387035547 --- include/pybind11/pybind11.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 3e1a057dbf..b87fe66b27 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -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); Py_DECREF(co_varnames); PyObject *self_caller = dict_getitem(locals, self_arg); - Py_DECREF(locals); if (self_caller == self.ptr()) { Py_DECREF(f_code); Py_DECREF(frame);