X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=server.cpp;h=8025fd1b4cb257ee71aa6a280a98c1913e007e73;hb=581694ded2a2de99cad7383f04a0ee1fb588f27d;hp=35cb9d6bce869b354f73b96f1824e004cf1835ec;hpb=7ec54788f88dde7b083ba6cfd30732b32295b54a;p=cubemap 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