Author: Amaury Forgeot d'Arc <[email protected]>
Branch: cpyext-PyThreadState_New
Changeset: r57659:cd71beb7aa2a
Date: 2012-09-29 08:27 +0200
http://bitbucket.org/pypy/pypy/changeset/cd71beb7aa2a/
Log: Move a bad DECREF, and add a call to PyThreadState_Clear(), my tests
still crash.
diff --git a/pypy/module/cpyext/test/callback_in_thread.c
b/pypy/module/cpyext/test/callback_in_thread.c
--- a/pypy/module/cpyext/test/callback_in_thread.c
+++ b/pypy/module/cpyext/test/callback_in_thread.c
@@ -29,6 +29,12 @@
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);
@@ -36,7 +42,6 @@
until you need it the next time. */
PyThreadState_Delete(tstate);
- Py_DECREF(data->callback);
free(data);
return NULL;
}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit