]> granicus.if.org Git - python/commitdiff
ctypes: DECREF error_object _after_ re-acquiring GIL
authorKristjan Valur Jonsson <sweskman@gmail.com>
Fri, 21 Dec 2012 10:32:57 +0000 (10:32 +0000)
committerKristjan Valur Jonsson <sweskman@gmail.com>
Fri, 21 Dec 2012 10:32:57 +0000 (10:32 +0000)
Modules/_ctypes/callproc.c

index ef3e97408c06da7f70bae9e5dd303a2520f20258..23825a7110d7fa20829fad10fbf503a7234f0104 100644 (file)
@@ -844,11 +844,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) {