diff Modules/_ctypes/callbacks.c @ 72366:eae8e4ab0455 3.2

Issue #12483: ctypes: Fix a crash when the destruction of a callback object triggers the garbage collector.
author Amaury Forgeot d'Arc <amauryfa@gmail.com>
date Mon, 12 Sep 2011 21:03:36 +0200
parents dc245d681901
children 763af3d957f3 de1ea7f84e08
line wrap: on
line diff
--- a/Modules/_ctypes/callbacks.c	Mon Sep 12 17:15:26 2011 +0200
+++ b/Modules/_ctypes/callbacks.c	Mon Sep 12 21:03:36 2011 +0200
@@ -13,6 +13,7 @@
 CThunkObject_dealloc(PyObject *_self)
 {
     CThunkObject *self = (CThunkObject *)_self;
+    PyObject_GC_UnTrack(self);
     Py_XDECREF(self->converters);
     Py_XDECREF(self->callable);
     Py_XDECREF(self->restype);