Thanks to visit codestin.com Credit goes to github.com
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 b7337a7 commit 9e0dd70Copy full SHA for 9e0dd70
Modules/_cursesmodule.c
@@ -4898,8 +4898,9 @@ curses_capi_free(void *capi)
4898
{
4899
assert(capi != NULL);
4900
void **capi_ptr = (void **)capi;
4901
- assert(capi_ptr[0] != NULL);
4902
- Py_DECREF(capi_ptr[0]); // decref curses window type
+ // In free-threaded builds, capi_ptr[0] may have been already cleared
+ // by curses_capi_capsule_destructor(), hence the use of Py_XDECREF().
4903
+ Py_XDECREF(capi_ptr[0]); // decref curses window type
4904
PyMem_Free(capi_ptr);
4905
}
4906
0 commit comments