From: Otto Moerbeek Date: Mon, 28 Oct 2024 13:45:07 +0000 (+0100) Subject: rec: release ref to key in MTasker::waitEvent X-Git-Tag: rec-5.2.0-alpha1~9^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0f508176fddd421fbbd52d4e4057d182653dbd6;p=thirdparty%2Fpdns.git rec: release ref to key in MTasker::waitEvent If we do not do that, only the next call of sendEvent will release the shared pointer to the TCPConnectionHanlder in PacketID. This might delay cleaning TCP objects up on not-so-busy threads. Fixes #13422, thought it can still take a while on idle recursors, as the housekeeping function is not called often in those cases. --- diff --git a/pdns/recursordist/mtasker.hh b/pdns/recursordist/mtasker.hh index a45f64d832..1287e94455 100644 --- a/pdns/recursordist/mtasker.hh +++ b/pdns/recursordist/mtasker.hh @@ -305,7 +305,7 @@ int MTasker::waitEvent(EventKey& key, EventVal* val, un if ((char*)&waiter < d_threads[d_tid].highestStackSeen) { d_threads[d_tid].highestStackSeen = (char*)&waiter; } - key = d_eventkey; + key = std::move(d_eventkey); return d_waitstatus; }