remove the socket from the event queue on dealloc.

This commit is contained in:
Joris Vink 2019-03-13 16:01:42 +01:00
parent b06160c768
commit d41054bd26
1 changed files with 7 additions and 0 deletions

View File

@ -1657,6 +1657,13 @@ pysocket_alloc(void)
static void
pysocket_dealloc(struct pysocket *sock)
{
if (sock->scheduled) {
kore_platform_disable_read(sock->fd);
#if !defined(__linux__)
kore_platform_disable_write(sock->fd);
#endif
}
if (sock->socket != NULL) {
Py_DECREF(sock->socket);
} else if (sock->fd != -1) {