Commits

Amaury Forgeot d'Arc  committed cd71beb

Move a bad DECREF, and add a call to PyThreadState_Clear(), my tests still crash.

  • Participants
  • Parent commits 09a0ae4
  • Branches cpyext-PyThreadState_New

Comments (0)

Files changed (1)

File pypy/module/cpyext/test/callback_in_thread.c

     else
 	Py_DECREF(result);
 
+    Py_DECREF(data->callback);
+
+    /* XXX Python examples don't mention it, but docs say that
+     * PyThreadState_Delete requires it. */
+    PyThreadState_Clear(tstate);
+
     /* Release the thread. No Python API allowed beyond this point. */
     PyEval_ReleaseThread(tstate);
 
        until you need it the next time. */
     PyThreadState_Delete(tstate);
 
-    Py_DECREF(data->callback);
     free(data);
     return NULL;
 }