diff --git a/code/ryzom/client/src/actions.cpp b/code/ryzom/client/src/actions.cpp index d2dffb504..6b9a3649b 100644 --- a/code/ryzom/client/src/actions.cpp +++ b/code/ryzom/client/src/actions.cpp @@ -148,9 +148,16 @@ void CActionsManager::removeCombo (const CCombo &combo) while ((ite != _KeyAction.end ()) && (ite->first == combo.Key)) { TKeyActionMap::iterator copyToDelete = ite; - ite++; +#ifdef NL_ISO_CPP0X_AVAILABLE + if (copyToDelete->second == oldName) + ite = _KeyAction.erase (copyToDelete); + else + ++ite; +#else + ++ite; if (copyToDelete->second == oldName) _KeyAction.erase (copyToDelete); +#endif } // Remove the action @@ -320,7 +327,7 @@ void CActionsManager::keyReleased (const CEventKeyUp &keyUp) TKeyActionMap::iterator iteWatchedAction = _WatchedActions.begin (); while (iteWatchedAction != _WatchedActions.end ()) { - TKeyActionMap::iterator iteToDelete = iteWatchedAction++; + TKeyActionMap::iterator iteToDelete = iteWatchedAction; // Get the combo for this action TActionComboMap::iterator iteCombo = _ActionCombo.find (iteToDelete->second); @@ -334,7 +341,15 @@ void CActionsManager::keyReleased (const CEventKeyUp &keyUp) nlassert (iteAction != _Actions.end()); // Remove this action from watching +#ifdef NL_ISO_CPP0X_AVAILABLE + // C++11 return the next item + iteWatchedAction = _WatchedActions.erase (iteToDelete); +#else + // remember the next iterator only if not using C++11 + ++iteWatchedAction; + _WatchedActions.erase (iteToDelete); +#endif // Invalidate the action bool LastValid = iteAction->second.Valide; @@ -349,6 +364,10 @@ void CActionsManager::keyReleased (const CEventKeyUp &keyUp) } } } + else + { + ++iteWatchedAction; + } } } }