We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bebd66 commit 13b2fb8Copy full SHA for 13b2fb8
context/_coroutine.c
@@ -107,7 +107,11 @@ static void *coroutine_wrapper(void *action_, void *arg_)
107
Py_DECREF(arg);
108
109
110
-#if PY_VERSION_HEX < 0x30B0000
+#if PY_VERSION_HEX >= 0x30B0000
111
+ new_threadstate = PyThreadState_Swap(thread_state);
112
+ PyThreadState_Clear(new_threadstate);
113
+ PyThreadState_Delete(new_threadstate);
114
+#else
115
/* Some of the stuff we've initialised can leak through, so far I've only
116
* seen exc_type still set at this point, but maybe other fields can also
117
* leak. Avoid a memory leak by making sure we're not holding onto these.
0 commit comments