diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 109d326e3..cdaf2e3d4 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -619,12 +619,10 @@ void AIStateMachine::flush(void) AIReadAccess csme_r(sContinuedStateMachinesAndMainloopEnabled); add_continued_statemachines(csme_r); } - // Kill all state machines. - for (active_statemachines_type::iterator iter = active_statemachines.begin(); iter != active_statemachines.end(); ++iter) - { - AIStateMachine& statemachine(iter->statemachine()); - if (statemachine.running()) - statemachine.kill(); - } } + // At this point all statemachines should be idle. + AIReadAccess csme_r(sContinuedStateMachinesAndMainloopEnabled); + llinfos << "Current number of continued statemachines: " << csme_r->continued_statemachines.size() << llendl; + llinfos << "Current number of active statemachines: " << active_statemachines.size() << llendl; + llassert(csme_r->continued_statemachines.empty() && active_statemachines.empty()); }