! * \brief destroys everything init_io_wait allocated * \param h IO handle */
| 671 | * \param h IO handle |
| 672 | */ |
| 673 | void destroy_io_wait(io_wait_h* h) |
| 674 | { |
| 675 | switch(h->poll_method){ |
| 676 | #ifdef HAVE_EPOLL |
| 677 | case POLL_EPOLL: |
| 678 | destroy_epoll(h); |
| 679 | if (h->ep_array){ |
| 680 | local_free(h->ep_array); |
| 681 | h->ep_array=0; |
| 682 | } |
| 683 | break; |
| 684 | #endif |
| 685 | #ifdef HAVE_KQUEUE |
| 686 | case POLL_KQUEUE: |
| 687 | destroy_kqueue(h); |
| 688 | if (h->kq_array){ |
| 689 | local_free(h->kq_array); |
| 690 | h->kq_array=0; |
| 691 | } |
| 692 | if (h->kq_changes){ |
| 693 | local_free(h->kq_changes); |
| 694 | h->kq_changes=0; |
| 695 | } |
| 696 | break; |
| 697 | #endif |
| 698 | #ifdef HAVE_SIGIO_RT |
| 699 | case POLL_SIGIO_RT: |
| 700 | destroy_sigio(h); |
| 701 | break; |
| 702 | #endif |
| 703 | #ifdef HAVE_DEVPOLL |
| 704 | case POLL_DEVPOLL: |
| 705 | destroy_devpoll(h); |
| 706 | if (h->dp_changes){ |
| 707 | local_free(h->dp_changes); |
| 708 | h->dp_changes=0; |
| 709 | } |
| 710 | break; |
| 711 | #endif |
| 712 | default: /*do nothing*/ |
| 713 | ; |
| 714 | } |
| 715 | if (h->fd_array){ |
| 716 | local_free(h->fd_array); |
| 717 | h->fd_array=0; |
| 718 | } |
| 719 | if (h->fd_hash){ |
| 720 | local_free(h->fd_hash); |
| 721 | h->fd_hash=0; |
| 722 | } |
| 723 | if (h->prio_idx){ |
| 724 | local_free(h->prio_idx); |
| 725 | h->prio_idx=0; |
| 726 | } |
| 727 | |
| 728 | } |
| 729 | |
| 730 |
no test coverage detected