From a9e73847289104ea83a5d635c0c8f6c85de8174d Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Wed, 2 Oct 2024 14:24:33 +0100 Subject: [PATCH] HPCC-32758 Ensure setActivity() destroys activities outside the critical section Signed-off-by: Gavin Halliday --- roxie/ccd/ccdqueue.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roxie/ccd/ccdqueue.cpp b/roxie/ccd/ccdqueue.cpp index 5e41da7fbbf..322baca78c9 100644 --- a/roxie/ccd/ccdqueue.cpp +++ b/roxie/ccd/ccdqueue.cpp @@ -1409,8 +1409,12 @@ class CRoxieWorker : public CInterface, implements IPooledThread } inline void setActivity(IRoxieAgentActivity *act) { - CriticalBlock b(actCrit); - activity.setown(act); + //Ensure that the activity is released outside of the critical section + Owned temp(act); + { + CriticalBlock b(actCrit); + activity.swap(temp); + } } inline bool match(RoxiePacketHeader &h) {