libev migration - shutdown cleanly.
[citadel.git] / citadel / modules / eventclient / serv_eventclient.c
index ecd5cf67d3562675e7bdb5f9476eeaff44ece443..d135dccf6c4547f668aef00778ab0e1fa25a9077 100644 (file)
@@ -107,7 +107,8 @@ static void QueueEventAddCallback(struct ev_loop *loop, ev_io *watcher, int reve
                /////event_del(&queue_add_event);
                close(event_add_pipe[0]);
 /// TODO; flush QueueEvents fd's and delete it.
-               ev_io_stop(event_base, NULL);
+               ev_io_stop(event_base, &queue_add_event);
+               ev_unloop(event_base, EVUNLOOP_ALL);
        }
        /* Unblock the other side */
 //     read(fd, buf, 1);