tool manager: Don't adjust the iterator to invalid

When finishing the first tool, we don't want to return an invalid
iterator
This commit is contained in:
Seth Hillbrand 2019-11-03 10:15:21 -08:00
parent 11f0acefe2
commit cbb88ce609
1 changed files with 4 additions and 0 deletions

View File

@ -837,6 +837,10 @@ TOOL_MANAGER::ID_LIST::iterator TOOL_MANAGER::finishTool( TOOL_STATE* aState )
if( tool->GetType() == INTERACTIVE )
static_cast<TOOL_INTERACTIVE*>( tool )->resetTransitions();
// Don't move the iterator past the stack beginning
if( it == m_activeTools.begin() )
return it;
return --it;
}