Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-104456: Fix ref leak in test_ctypes
  • Loading branch information
Eclips4 committed May 13, 2023
commit 8dbad0945a2b92731b02e427ceee6ba08aed96ca
8 changes: 8 additions & 0 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5487,6 +5487,14 @@ static void
comerror_dealloc(PyObject *self)
{
PyTypeObject *tp = Py_TYPE(self);
PyBaseExceptionObject *obj = (PyBaseExceptionObject *) self;

Py_CLEAR(obj->dict);
Py_CLEAR(obj->args);
Py_CLEAR(obj->notes);
Py_CLEAR(obj->traceback);
Py_CLEAR(obj->cause);
Py_CLEAR(obj->context);
PyObject_GC_UnTrack(self);
tp->tp_free(self);
Py_DECREF(tp);
Expand Down