diff options
author | Christopher Davis <chrisd@torproject.org> | 2010-08-28 02:08:27 -0700 |
---|---|---|
committer | Christopher Davis <chrisd@torproject.org> | 2010-09-08 01:22:21 -0700 |
commit | d844242f9b138be4896942ded25d74a91bf29901 (patch) | |
tree | 5edb40d6cb73b0638802e961c0265ba3be1532e1 /event.c | |
parent | 03afa209de96d67f1a4b935460aeabe63f5ef24f (diff) | |
download | libevent-d844242f9b138be4896942ded25d74a91bf29901.tar.gz |
Stop IOCP when freeing the event_base.
Diffstat (limited to 'event.c')
-rw-r--r-- | event.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -639,6 +639,20 @@ event_base_start_iocp(struct event_base *base) } void +event_base_stop_iocp(struct event_base *base) +{ +#ifdef WIN32 + int rv; + + if (!base->iocp) + return; + rv = event_iocp_shutdown(base->iocp, -1); + EVUTIL_ASSERT(rv >= 0); + base->iocp = NULL; +#endif +} + +void event_base_free(struct event_base *base) { int i, n_deleted=0; @@ -654,6 +668,10 @@ event_base_free(struct event_base *base) /* XXX(niels) - check for internal events first */ EVUTIL_ASSERT(base); +#ifdef WIN32 + event_base_stop_iocp(base); +#endif + /* threading fds if we have them */ if (base->th_notify_fd[0] != -1) { event_del(&base->th_notify); |