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) {