From: Kristjan Valur Jonsson Date: Fri, 21 Dec 2012 10:32:57 +0000 (+0000) Subject: ctypes: DECREF error_object _after_ re-acquiring GIL X-Git-Tag: v2.7.5~109^2~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed512a4d0969a93402e3d4245540dff24b0dce4c;p=thirdparty%2FPython%2Fcpython.git ctypes: DECREF error_object _after_ re-acquiring GIL --- diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index ef3e97408c06..23825a7110d7 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -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) {