Issue #26563: Replace PyMem_Malloc() with PyMem_RawFree() since
PostToQueueCallback() calls PyMem_RawFree() (previously PyMem_Free()) in a new
C thread which doesn't hold the GIL.
PostQueuedCompletionStatus(p->CompletionPort, TimerOrWaitFired,
0, p->Overlapped);
/* ignore possible error! */
- PyMem_Free(p);
+ PyMem_RawFree(p);
}
PyDoc_STRVAR(
&Milliseconds))
return NULL;
- pdata = PyMem_Malloc(sizeof(struct PostCallbackData));
+ /* Use PyMem_RawMalloc() rather than PyMem_Malloc(), since
+ PostToQueueCallback() will call PyMem_Free() from a new C thread
+ which doesn't hold the GIL. */
+ pdata = PyMem_RawMalloc(sizeof(struct PostCallbackData));
if (pdata == NULL)
return SetFromWindowsErr(0);
pdata, Milliseconds,
WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE))
{
- PyMem_Free(pdata);
+ PyMem_RawFree(pdata);
return SetFromWindowsErr(0);
}