From 1d2983bbf54799785b650f9a8022b88429a23d26 Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Tue, 7 Sep 2021 16:49:46 +0900 Subject: [PATCH] Fix fd leak Change-Id: I4d74acb337b0fd4aaac6fb911055ac702dd055b3 --- src/shared/event_loop.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shared/event_loop.cpp b/src/shared/event_loop.cpp index e0e9799..a60ba38 100644 --- a/src/shared/event_loop.cpp +++ b/src/shared/event_loop.cpp @@ -102,6 +102,9 @@ event_loop::event_loop(GMainLoop *mainloop) event_loop::~event_loop() { + if (m_term_fd != -1) + close(m_term_fd); + _D("Destoryed"); } @@ -268,7 +271,7 @@ bool event_loop::run(int timeout) g_source_unref(src); } - m_term_fd = eventfd(0, 0); + m_term_fd = eventfd(0, EFD_CLOEXEC); retv_if(m_term_fd == -1, false); terminator *handler = new(std::nothrow) terminator(this); -- 2.7.4