From ea66c8302a20b268cf67230c5d237773e4c6697d Mon Sep 17 00:00:00 2001 From: Andrii Kroitor Date: Tue, 27 Dec 2016 15:52:30 +0200 Subject: [PATCH] ecore_main: don't wait on marked to delete handlers on Windows This could lead to greedy wait with 100% CPU consumption because on wait error we never reach actual handlers deletion. --- src/lib/ecore/ecore_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index 91bff0ea82..9b8f9f994c 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -2598,6 +2598,9 @@ _ecore_main_win32_select(int nfds EINA_UNUSED, /* Create an event object per socket */ EINA_INLIST_FOREACH(fd_handlers, fdh) { + if (fdh->delete_me) + continue; + WSAEVENT event; long network_event; @@ -2632,6 +2635,9 @@ _ecore_main_win32_select(int nfds EINA_UNUSED, /* store the HANDLEs in the objects to wait for */ EINA_INLIST_FOREACH(win32_handlers, wh) { + if (wh->delete_me) + continue; + if (wh->h == stdin_handle) { if (stdin_wait_thread == INVALID_HANDLE_VALUE)