]> granicus.if.org Git - python/commitdiff
Fixed refcount bug. I placed Py_INCREF in create_comerror() for compatibility
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Sun, 12 Sep 2010 16:06:18 +0000 (16:06 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Sun, 12 Sep 2010 16:06:18 +0000 (16:06 +0000)
with Python2.7.

Modules/_ctypes/_ctypes.c

index a6df55cad72b696885c532c4028f1d277171af2e..aaf46eac68bcb9971afb9f40f6a860956375223b 100644 (file)
@@ -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;
 }