X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=server.cpp;h=a6f45744e1576b03065c712767bf4cea5078eb45;hp=35cb9d6bce869b354f73b96f1824e004cf1835ec;hb=HEAD;hpb=7ec54788f88dde7b083ba6cfd30732b32295b54a diff --git a/server.cpp b/server.cpp index 35cb9d6..8025fd1 100644 --- a/server.cpp +++ b/server.cpp @@ -60,7 +60,7 @@ inline bool is_earlier(timespec a, timespec b) Server::Server() { - epoll_fd = epoll_create(1024); // Size argument is ignored. + epoll_fd = epoll_create1(EPOLL_CLOEXEC); if (epoll_fd == -1) { log_perror("epoll_fd"); exit(1); @@ -70,6 +70,11 @@ Server::Server() Server::~Server() { safe_close(epoll_fd); + + // We're going to die soon anyway, but clean this up to keep leak checking happy. + for (const auto &acceptor_and_context : tls_server_contexts) { + tls_destroy_context(acceptor_and_context.second); + } } vector Server::get_client_stats() const