--- a/src/server/daemon/event.c Fri Aug 16 16:59:05 2024 +0200 +++ b/src/server/daemon/event.c Fri Aug 16 18:09:05 2024 +0200 @@ -78,11 +78,25 @@ return ret; } +void evhandler_shutdown(EVHandler *h) { + for(int i=0;i<h->numins;i++) { + ev_instance_shutdown(h->instances[i]); + } +} + void evhandler_close(EVHandler *h) { for(int i=0;i<h->numins;i++) { ev_instance_close(h->instances[i]); } - h->numins = 0; +} + +void evhandler_wait_and_destroy(EVHandler *h) { + for(int i=0;i<h->numins;i++) { + ev_instance_wait(h->instances[i]); + } + + free(h->instances); + free(h); } /*