| 204 | } |
| 205 | |
| 206 | EventCenter::~EventCenter() |
| 207 | { |
| 208 | { |
| 209 | std::lock_guard<std::mutex> l(external_lock); |
| 210 | while (!external_events.empty()) { |
| 211 | EventCallbackRef e = external_events.front(); |
| 212 | if (e) |
| 213 | e->do_request(0); |
| 214 | external_events.pop_front(); |
| 215 | } |
| 216 | } |
| 217 | time_events.clear(); |
| 218 | //assert(time_events.empty()); |
| 219 | |
| 220 | if (notify_receive_fd >= 0) |
| 221 | compat_closesocket(notify_receive_fd); |
| 222 | #ifndef __linux__ |
| 223 | /* on Linux, notify_receive_fd and notify_send_fd are the same |
| 224 | eventfd, therefore we close only one of them */ |
| 225 | if (notify_send_fd >= 0) |
| 226 | compat_closesocket(notify_send_fd); |
| 227 | #endif |
| 228 | |
| 229 | delete driver; |
| 230 | if (notify_handler) |
| 231 | delete notify_handler; |
| 232 | } |
| 233 | |
| 234 | |
| 235 | void EventCenter::set_owner() |
nothing calls this directly
no test coverage detected