From d41054bd265b4a3487c094bf9c9b991c0ce8253b Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Wed, 13 Mar 2019 16:01:42 +0100 Subject: [PATCH] remove the socket from the event queue on dealloc. --- src/python.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/python.c b/src/python.c index 2631cbc..d40564d 100644 --- a/src/python.c +++ b/src/python.c @@ -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) {