From 34aa30ca2b99cbc3157ca9ff7b1499860c7ab5ac Mon Sep 17 00:00:00 2001 From: Hirokazu Yamamoto Date: Sun, 12 Sep 2010 16:06:18 +0000 Subject: [PATCH] Fixed refcount bug. I placed Py_INCREF in create_comerror() for compatibility with Python2.7. --- Modules/_ctypes/_ctypes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index a6df55cad72..aaf46eac68b 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -5120,6 +5120,7 @@ create_comerror(void) PyComError_Type.tp_base = (PyTypeObject*)PyExc_Exception; if (PyType_Ready(&PyComError_Type) < 0) return -1; + Py_INCREF(&PyComError_Type); ComError = (PyObject*)&PyComError_Type; return 0; }