nghttpx: Fix memory leak

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-02 02:07:29 +09:00
parent d70eb14ce0
commit e1f7643c92
2 changed files with 4 additions and 0 deletions

View File

@ -2617,6 +2617,8 @@ int main(int argc, char **argv) {
LOG(NOTICE) << "Shutdown momentarily"; LOG(NOTICE) << "Shutdown momentarily";
delete log_config();
return 0; return 0;
} }

View File

@ -101,6 +101,7 @@ Worker::Worker(struct ev_loop *loop, SSL_CTX *sv_ssl_ctx, SSL_CTX *cl_ssl_ctx,
Worker::~Worker() { Worker::~Worker() {
ev_async_stop(loop_, &w_); ev_async_stop(loop_, &w_);
ev_timer_stop(loop_, &mcpool_clear_timer_); ev_timer_stop(loop_, &mcpool_clear_timer_);
ev_loop_destroy(loop_);
} }
void Worker::schedule_clear_mcpool() { void Worker::schedule_clear_mcpool() {
@ -121,6 +122,7 @@ void Worker::run_async() {
fut_ = std::async(std::launch::async, [this] { fut_ = std::async(std::launch::async, [this] {
(void)reopen_log_files(); (void)reopen_log_files();
ev_run(loop_); ev_run(loop_);
delete log_config();
}); });
#endif // !NOTHREADS #endif // !NOTHREADS
} }