From 5a8b440a214384b016d2e08872f2985d4500be68 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Thu, 23 Jan 2025 18:40:20 +0000 Subject: [PATCH] fix(libsinsp/parsers): call immediately call on_erase_fd callback Signed-off-by: Roberto Scolaro --- userspace/libsinsp/parsers.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/userspace/libsinsp/parsers.cpp b/userspace/libsinsp/parsers.cpp index bc66c36960..821fdb0d7f 100644 --- a/userspace/libsinsp/parsers.cpp +++ b/userspace/libsinsp/parsers.cpp @@ -3226,17 +3226,7 @@ void sinsp_parser::erase_fd(erase_fd_params *params) { // If there's a listener, add a callback to later invoke it. // if(m_inspector->get_observer()) { - auto ts = params->m_ts; - auto remove_from_table = params->m_remove_from_table; - auto fd = params->m_fd; - auto tinfo = params->m_tinfo; - auto fdinfo = params->m_fdinfo; - m_inspector->m_post_process_cbs.emplace( - [ts, remove_from_table, fd, tinfo, fdinfo](sinsp_observer *observer, - sinsp_evt *evt) { - erase_fd_params p = {remove_from_table, fd, tinfo, fdinfo, ts}; - observer->on_erase_fd(&p); - }); + m_inspector->get_observer()->on_erase_fd(params); } }