]> granicus.if.org Git - python/commitdiff
Don't DECREF the ctypes error_object without the GIL held.
authorKristjan Valur Jonsson <sweskman@gmail.com>
Fri, 21 Dec 2012 09:41:25 +0000 (09:41 +0000)
committerKristjan Valur Jonsson <sweskman@gmail.com>
Fri, 21 Dec 2012 09:41:25 +0000 (09:41 +0000)
Modules/_ctypes/callproc.c

index 41a90f664759173585674d77e757ee6beaf9da39..e7b53b886b4c99731faa63bfc5f0ea8606a5b448 100644 (file)
@@ -834,11 +834,11 @@ static int _call_function_pointer(int flags,
         space[0] = errno;
         errno = temp;
     }
-    Py_XDECREF(error_object);
 #ifdef WITH_THREAD
     if ((flags & FUNCFLAG_PYTHONAPI) == 0)
         Py_BLOCK_THREADS
 #endif
+    Py_XDECREF(error_object);
 #ifdef MS_WIN32
 #ifndef DONT_USE_SEH
     if (dwExceptionCode) {