eio: avoid access after death of eio handler due to inotify triggering IN_IGNORED event.

This commit is contained in:
Cedric Bail 2016-07-15 17:02:03 -07:00
parent bf369ba661
commit e93d6f90db
1 changed files with 5 additions and 0 deletions

View File

@ -141,6 +141,9 @@ _eio_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
if ((event_size + i) > size) break ;
i += event_size;
// No need to waste time looking up for just destroyed handler
if ((event->mask & IN_IGNORED)) continue ;
backend = eina_hash_find(_inotify_monitors, &event->wd);
if (!backend) continue ;
if (!backend->parent) continue ;
@ -268,6 +271,8 @@ void eio_monitor_backend_del(Eio_Monitor *monitor)
monitor->backend = NULL;
if (!backend) return;
backend->parent = NULL;
eina_hash_del(_inotify_monitors, &backend->hwnd, backend);
}