[Python-checkins] r45535 - python/trunk/Modules/_ctypes/_ctypes.c (original) (raw)

thomas.heller python-checkins at python.org
Tue Apr 18 16:57:40 CEST 2006


Author: thomas.heller Date: Tue Apr 18 16:57:39 2006 New Revision: 45535

Modified: python/trunk/Modules/_ctypes/_ctypes.c Log: Fix refcounting. This makes 'import ctypes; reload(ctypes)' no longer leak reference counts.

Modified: python/trunk/Modules/_ctypes/_ctypes.c

--- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Tue Apr 18 16:57:39 2006 @@ -1283,6 +1283,7 @@ suffix = PyString_FromString("_be"); #endif

@@ -1459,6 +1460,7 @@ PyObject_SetAttrString(swapped, "ctype_le", (PyObject *)result); PyObject_SetAttrString(swapped, "ctype_be", swapped); #endif + Py_DECREF(swapped); };

 return (PyObject *)result;


More information about the Python-checkins mailing list