Use a weak pointer to hold on to the the underlying thread plan in SBThreadPlan. When the process continues, all the popped ThreadPlans get discarded, and you can’t reuse them, so you have to create them anew. Therefore the SBThreadPlan doesn’t need to keep the ThreadPlan alive. This fixes the cleanup error in TestThreadPlanCommands.py and TestStepScripted.py caused by the thread plans never being deleted.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Yes, the only way you can get your hands on an SBThreadPlan is in the process of queueing one, so the ThreadPlan stack will always be the one to manage the lifecycle of a plan. And if an SBThreadPlan represents a ThreadPlan that has been discarded, it should convert back to an empty SBThreadPlan rather than keeping the underlying plan alive. So this is correct.