From e88c39b09007dfea303d45df4e2c6b8159174ad0 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 7 Nov 2012 01:53:12 +0100 Subject: [PATCH] AIStateMachine::flush can only make statemachines idle. As idle statemachines aren't in any list, it's not possible (without adding that list) to delete them. I don't think that there are any active statemachines left at the end of flush anyway, but killing them doesn't much sense if we can't get them all: there will always be statemachines left: those that were idle at the moment the viewer was quit. --- indra/aistatemachine/aistatemachine.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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()); }